<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="xml" omit-xml-declaration="yes"/>


<xsl:template name="set-index-style-and-script">

<!--*****************These are system variables	the skin uses....do not	change these***************-->
<xsl:variable name="file-container"><xsl:call-template name="substring-after-last"><xsl:with-param name="string" select="files/file[1]/fileURL"	/><xsl:with-param name="delimiter" select="'.'"	/></xsl:call-template></xsl:variable>
<xsl:variable name="short-plot"><xsl:call-template name="substring-before-last"><xsl:with-param	name="string" select="plot" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template></xsl:variable>
<xsl:variable name="plot"><xsl:value-of	select="plot"/></xsl:variable>
<xsl:variable name="typeA"><xsl:call-template name="substring-after-last"><xsl:with-param name="string"	select="files/file[1]/fileURL" /><xsl:with-param name="delimiter" select="'file:///opt/sybhttpd/localhost.drives/'" /></xsl:call-template></xsl:variable>
<xsl:variable name="typeB"><xsl:call-template name="plot"><xsl:with-param name="string"	select="$typeA"	/><xsl:with-param name="delimiter" select="'/'"	/></xsl:call-template></xsl:variable>
<xsl:variable name="fileplace"><xsl:call-template name="substring-after-last"><xsl:with-param name="string" select="files/file[1]/fileURL" /><xsl:with-param name="delimiter" select="'file:///opt/sybhttpd/localhost.drives/'"	/></xsl:call-template></xsl:variable>

<!--********************End of system variables*****************************-->

<style>


<xsl:choose>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 8">
		#image9 {position:absolute;left:990;top:230;visibility:visible;}
		#overlay9 {position:absolute;left:984;top:228;visibility:visible;}
	</xsl:when>
	<xsl:otherwise>
		#image9 {position:absolute;left:990;top:230;visibility:hidden;}
		#overlay9 {position:absolute;left:984;top:228;visibility:hidden;}
	</xsl:otherwise>
</xsl:choose>

<xsl:choose>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 7">
		#image8 {position:absolute;left:940;top:217;visibility:visible;}
		#overlay8 {position:absolute;left:932;top:212;visibility:visible;}
	</xsl:when>
	<xsl:otherwise>
		#image8 {position:absolute;left:940;top:217;visibility:hidden;}
		#overlay8 {position:absolute;left:932;top:212;visibility:hidden;}
	</xsl:otherwise>
</xsl:choose>

<xsl:choose>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 6">
		#image7 {position:absolute;left:875;top:205;visibility:visible;}
		#overlay7 {position:absolute;left:865;top:200;visibility:visible;}
	</xsl:when>
	<xsl:otherwise>
		#image7 {position:absolute;left:875;top:205;visibility:hidden;}
		#overlay7 {position:absolute;left:865;top:200;visibility:hidden;}
	</xsl:otherwise>
</xsl:choose>

<xsl:choose>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 5">
		#image6 {position:absolute;left:790;top:192;visibility:visible;}
		#overlay6 {position:absolute;left:779;top:185;visibility:visible;}
	</xsl:when>
	<xsl:otherwise>
		#image6 {position:absolute;left:790;top:192;visibility:hidden;}
		#overlay6 {position:absolute;left:779;top:185;visibility:hidden;}
	</xsl:otherwise>
</xsl:choose>

<xsl:choose>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 4">
		#image5 {position:absolute;left:690;top:180;visibility:visible;}
		#overlay5 {position:absolute;left:675;top:173;visibility:visible;}
	</xsl:when>
	<xsl:otherwise>
		#image5 {position:absolute;left:690;top:180;visibility:hidden;}
		#overlay5 {position:absolute;left:675;top:173;visibility:hidden;}
	</xsl:otherwise>
</xsl:choose>

<xsl:choose>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 3">
		#image4 {position:absolute;left:570;top:168;visibility:visible;}
		#overlay4 {position:absolute;left:554;top:158;visibility:visible;}
	</xsl:when>
	<xsl:otherwise>
		#image4 {position:absolute;left:570;top:168;visibility:hidden;}
		#overlay4 {position:absolute;left:554;top:158;visibility:hidden;}
	</xsl:otherwise>
</xsl:choose>

<xsl:choose>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 2">
		#image3 {position:absolute;left:430;top:150;visibility:visible;}
		#overlay3 {position:absolute;left:411;top:140;visibility:visible;}
	</xsl:when>
	<xsl:otherwise>
		#image3 {position:absolute;left:430;top:150;visibility:hidden;}
		#overlay3 {position:absolute;left:411;top:140;visibility:hidden;}
	</xsl:otherwise>
</xsl:choose>

<xsl:choose>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 1">
		#image2 {position:absolute;left:250;top:135;visibility:visible;}
		#overlay2 {position:absolute;left:231;top:125;visibility:visible;}
	</xsl:when>
	<xsl:otherwise>
		#image2 {position:absolute;left:250;top:135;visibility:hidden;}
		#overlay2 {position:absolute;left:231;top:125;visibility:hidden;}
	</xsl:otherwise>
</xsl:choose>

#changeimage {position:absolute;left:20;top:110;visibility:visible;}
#firstimageoverlay {position:absolute;left:1;top:100;visibility:visible;}



</style>
<xsl:if test="$right-corner='fanart'">
<style>
<xsl:choose>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 8">
		#imagechange {position:absolute;left:800;top:450;visibility:visible;}
		#fanartoverlay {position:absolute;left:800;top:450;visibility:visible;}
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 7">
		#imagechange {position:absolute;left:800;top:450;visibility:visible;}
		#fanartoverlay {position:absolute;left:800;top:450;visibility:visible;}
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 6">
		#imagechange {position:absolute;left:800;top:450;visibility:visible;}
		#fanartoverlay {position:absolute;left:800;top:450;visibility:visible;}
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 5">
		#imagechange {position:absolute;left:800;top:450;visibility:visible;}
		#fanartoverlay {position:absolute;left:800;top:450;visibility:visible;}
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 4">
		#imagechange {position:absolute;left:800;top:450;visibility:visible;}
		#fanartoverlay {position:absolute;left:800;top:450;visibility:visible;}
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 3">
		#imagechange {position:absolute;left:770;top:450;visibility:visible;}
		#fanartoverlay {position:absolute;left:770;top:450;visibility:visible;}
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 2">
		#imagechange {position:absolute;left:650;top:355;visibility:visible;}
		#fanartoverlay {position:absolute;left:650;top:355;visibility:visible;}
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 1">
		#imagechange {position:absolute;left:505;top:280;visibility:visible;}
		#fanartoverlay {position:absolute;left:505;top:280;visibility:visible;}
	</xsl:when>
</xsl:choose>
</style>						
</xsl:if>

<title>MovieJukebox</title>
<script type="text/javascript" src="pictures/passit.js">&#160;</script>

<xsl:if test="$play-index-files='true'">
<script>
var files=[
<xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:choose>
	 <xsl:when test="count(files/file) > 1"><xsl:value-of select="baseFilename"/>.playlist.jsp,playlist</xsl:when><xsl:otherwise><xsl:call-template name="substring-after-last"><xsl:with-param name="string" select="files/file[1]/fileURL" /><xsl:with-param name="delimiter" select="'file:///opt/sybhttpd/localhost.drives/'" /></xsl:call-template>,<xsl:choose><xsl:when test="container='DVD Video' or container='dvd video'">zcd</xsl:when><xsl:when test="container = 'ISO' or ends-with(files/file[1]/fileURL, '.ISO') or ends-with(files/file[1]/fileURL, '.iso')">zcd</xsl:when><xsl:when test="container = 'IMG' or ends-with(files/file[1]/fileURL, '.IMG') or ends-with(files/file[1]/fileURL, '.img')">zcd</xsl:when><xsl:when test="ends-with(files/file[1]/fileURL, 'VIDEO_TS')">zcd</xsl:when><xsl:otherwise>vod</xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];
</script>
</xsl:if>


<script>
var titles= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:value-of select="translate(title,'&#58;', &quot;-&quot;)" disable-output-escaping="yes"/><xsl:if test="season != -1"> - Season <xsl:value-of select="season" /></xsl:if>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];
</script>

<script>

var xon= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:choose><xsl:when test="@isSet='true'"><xsl:value-of select="substring-before(details,'.html')" disable-output-escaping="yes"/></xsl:when><xsl:otherwise><xsl:value-of select="baseFilename" disable-output-escaping="yes"/></xsl:otherwise></xsl:choose>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];

</script>

<script>

var imdb= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:value-of select='rating'/>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];

</script>

<script>
var yon=0;
var searching=1;
var searchlist=0;
var input=0;
var yon=0;
var titlelow=0;
var inputlow=0;
var yonda=0;


<!--######old code, just for reference    if( titlelow.substring(0,lengthtest)==input.substring(0,lengthtest) )#########-->

function searchthis()
{
yon=yon;

if (searching==1)
  {
	var I=0;
	input= prompt("Enter Search Word","")
	searchlist= new Array();

	var lengthtest=input.length;
	
	if (lengthtest==1)
		{
			for(I=0;I <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> titles.length; I++)
				{
		 			titlelow= titles[I].toLowerCase();
		  			inputlow= input.toLowerCase();
			
					if (titlelow.substring(0,3)=="the")
				 		{
					  		if( titlelow.substring(4,5)==input.substring(0,1))
								{
							  		searchlist[searchlist.length] = xon[I]
			 					}
				 		}
					else
						{
							if( titlelow.substring(0,1)==input.substring(0,1) )
			 					{
			 			  			searchlist[searchlist.length] = xon[I]
			 					}
						}
				}
		}

	else
		{
    
			for(I=0;I <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> titles.length; I++)
				{
		  			titlelow= titles[I].toLowerCase();
		  			inputlow= input.toLowerCase();

		  			if( titlelow.match(inputlow) )
			 			{
			  	  			searchlist[searchlist.length] = xon[I]
			 			}
		 		}

		}
		 yon=0;
		searching=0;
		document.getElementById('searchfilter').firstChild.nodeValue=input
		moviechange4(yon)
  
	}
else
	{
		searching=1;
		yonda = findItem( xon, searchlist[(yon + searchlist.length) % searchlist.length])
		document.getElementById('searchfilter').firstChild.nodeValue="-"
		moviechange4(yonda)

	}

}

</script>




<script>
var rating= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:value-of select='certification'/>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];


var ratingsys= new Array();

ratingsys['G']=1;
ratingsys['PG']=10;
ratingsys['PG-13']=13;
ratingsys['R']=18;
ratingsys['NC-17']=17;
ratingsys['Not Rated']=18;

ratingsys['TV-Y']=1;
ratingsys['TV-Y7']=8;
ratingsys['TV-G']=10;
ratingsys['TV-PG']=13;
ratingsys['TV-14']=15;
ratingsys['TV-MA']=16;

ratingsys['U']=1;
ratingsys['PG']=10;
ratingsys['12']=12;
ratingsys['12A']=13;
ratingsys['15']=15;
ratingsys['18']=18;
ratingsys['R18']=99;

ratingsys['X']=99;
ratingsys['XX']=99;
ratingsys['XXX']=99;

var ratingnow=0;
</script>


<script>

var switchTime=0;
var testmove=0;
var yonsa=0;


function moviechange(y)

{
yonsa=y
document.styleSheets[1].cssRules[14].style.visibility='visibile'
document.getElementById('changeimage').setAttribute("src", "pictures/indexmaincoveroverlay.png");

if (y ==1)
{

<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 4">
if (searching==0)
	{
		if (searchlist.length <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> 4)
			{
				document.styleSheets[1].cssRules[15].style.visibility='hidden'
			}
	}
else
	{
	document.styleSheets[1].cssRules[15].style.visibility='visible'
	}
</xsl:if>

document.styleSheets[1].cssRules[5].style.left='20'
document.styleSheets[1].cssRules[6].style.left='110'
document.styleSheets[1].cssRules[7].style.left='230'
document.styleSheets[1].cssRules[8].style.left='350'
document.styleSheets[1].cssRules[14].style.left='440'
document.styleSheets[1].cssRules[10].style.left='560'
document.styleSheets[1].cssRules[11].style.left='680'
document.styleSheets[1].cssRules[12].style.left='800'
document.styleSheets[1].cssRules[13].style.left='920'

document.styleSheets[1].cssRules[15].style.left='1040'

document.styleSheets[1].cssRules[10].style.top='390'

document.getElementById('image6').setAttribute("width", "115");


testmove = setTimeout("moviechange2("+yonsa+")", 1);
}
else if (y == -1)
{
<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 8">
if (searching==0)
	{
		if (searchlist.length <xsl:value-of select="'&gt;'" disable-output-escaping="yes"/> 8)
			{
				document.styleSheets[1].cssRules[16].style.visibility='hidden'
			 }
	}
else
	{
		document.styleSheets[1].cssRules[16].style.visibility='visible'
	}
</xsl:if>

document.styleSheets[1].cssRules[5].style.left='70'
document.styleSheets[1].cssRules[6].style.left='190'
document.styleSheets[1].cssRules[7].style.left='310'
document.styleSheets[1].cssRules[8].style.left='410'
document.styleSheets[1].cssRules[14].style.left='520'
document.styleSheets[1].cssRules[10].style.left='640'
document.styleSheets[1].cssRules[11].style.left='760'
document.styleSheets[1].cssRules[12].style.left='880'
document.styleSheets[1].cssRules[13].style.left='970'

document.styleSheets[1].cssRules[16].style.left='1'

document.styleSheets[1].cssRules[8].style.top='390'

document.getElementById('image4').setAttribute("width", "115");

testmove = setTimeout("moviechange2("+yonsa+")", 1);
}
else
{
moviechange4(yonsa)
}

}

function moviechange2(y)
{
yonsa=y

if (y ==1)
{
document.styleSheets[1].cssRules[5].style.left='10'
document.styleSheets[1].cssRules[6].style.left='70'
document.styleSheets[1].cssRules[7].style.left='190'
document.styleSheets[1].cssRules[8].style.left='310'
document.styleSheets[1].cssRules[14].style.left='415'
document.styleSheets[1].cssRules[10].style.left='520'
document.styleSheets[1].cssRules[11].style.left='640'
document.styleSheets[1].cssRules[12].style.left='760'
document.styleSheets[1].cssRules[13].style.left='880'

document.styleSheets[1].cssRules[15].style.left='1000'

document.styleSheets[1].cssRules[10].style.top='381'

document.getElementById('image6').setAttribute("width", "125");


testmove = setTimeout("moviechange3("+yonsa+")", 1);
}
else if (y == -1)
{
document.styleSheets[1].cssRules[5].style.left='110'
document.styleSheets[1].cssRules[6].style.left='230'
document.styleSheets[1].cssRules[7].style.left='350'
document.styleSheets[1].cssRules[8].style.left='450'
document.styleSheets[1].cssRules[14].style.left='560'
document.styleSheets[1].cssRules[10].style.left='680'
document.styleSheets[1].cssRules[11].style.left='800'
document.styleSheets[1].cssRules[12].style.left='920'
document.styleSheets[1].cssRules[13].style.left='980'

document.styleSheets[1].cssRules[16].style.left='10'

document.styleSheets[1].cssRules[8].style.top='381'

document.getElementById('image4').setAttribute("width", "125");


testmove = setTimeout("moviechange3("+yonsa+")", 1);
}
else 
{
moviechange4(yonsa)
}
}

function moviechange3(y)
{
yonsa=y

if (y == 1)
{
document.styleSheets[1].cssRules[5].style.left='5'
document.styleSheets[1].cssRules[6].style.left='50'
document.styleSheets[1].cssRules[7].style.left='170'
document.styleSheets[1].cssRules[8].style.left='290'
document.styleSheets[1].cssRules[14].style.left='400'
document.styleSheets[1].cssRules[10].style.left='500'
document.styleSheets[1].cssRules[11].style.left='620'
document.styleSheets[1].cssRules[12].style.left='740'
document.styleSheets[1].cssRules[13].style.left='860'

document.styleSheets[1].cssRules[15].style.left='980'

document.styleSheets[1].cssRules[10].style.top='372'

document.getElementById('image6').setAttribute("width", "135");


testmove = setTimeout("movietest("+yonsa+")", 1);
}
else if (y == -1)
{
document.styleSheets[1].cssRules[5].style.left='130'
document.styleSheets[1].cssRules[6].style.left='250'
document.styleSheets[1].cssRules[7].style.left='370'
document.styleSheets[1].cssRules[8].style.left='470'
document.styleSheets[1].cssRules[14].style.left='580'
document.styleSheets[1].cssRules[10].style.left='700'
document.styleSheets[1].cssRules[11].style.left='820'
document.styleSheets[1].cssRules[12].style.left='940'
document.styleSheets[1].cssRules[13].style.left='1000'

document.styleSheets[1].cssRules[16].style.left='20'

document.styleSheets[1].cssRules[8].style.top='372'

document.getElementById('image4').setAttribute("width", "135");


testmove = setTimeout("movietest("+yonsa+")", 1);
}
else 
{
moviechange4(yonsa)
}
}

function movietest(y)
{

yonsa=y

if (y == 1)
{
document.styleSheets[1].cssRules[5].style.left='1'
document.styleSheets[1].cssRules[6].style.left='30'
document.styleSheets[1].cssRules[7].style.left='150'
document.styleSheets[1].cssRules[8].style.left='270'
document.styleSheets[1].cssRules[14].style.left='390'
document.styleSheets[1].cssRules[10].style.left='480'
document.styleSheets[1].cssRules[11].style.left='600'
document.styleSheets[1].cssRules[12].style.left='720'
document.styleSheets[1].cssRules[13].style.left='840'

document.styleSheets[1].cssRules[15].style.left='960'

document.styleSheets[1].cssRules[10].style.top='362'

document.getElementById('image6').setAttribute("width", "140");
document.styleSheets[1].cssRules[5].style.visibility='hidden'

testmove2 = setTimeout("moviechange4("+yonsa+")", 1);
}
else if (y == -1)
{

document.styleSheets[1].cssRules[5].style.left='150'
document.styleSheets[1].cssRules[6].style.left='270'
document.styleSheets[1].cssRules[7].style.left='390'
document.styleSheets[1].cssRules[8].style.left='480'
document.styleSheets[1].cssRules[14].style.left='600'
document.styleSheets[1].cssRules[10].style.left='720'
document.styleSheets[1].cssRules[11].style.left='840'
document.styleSheets[1].cssRules[12].style.left='960'
document.styleSheets[1].cssRules[13].style.left='1020'

document.styleSheets[1].cssRules[13].style.visibility='hidden'

document.styleSheets[1].cssRules[16].style.left='30'

document.styleSheets[1].cssRules[8].style.top='362'

document.getElementById('image4').setAttribute("width", "140");


testmove2 = setTimeout("moviechange4("+yonsa+")", 1);
}
}

function moviechange4(y)
{
var glen = xon.length
var ending = glen - 1
var last = ending - 1

if (yon+y<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>0)
{
yon=ending
}
else if (yon+y<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>ending)
{
yon=0
}
else
{
yon=yon+y
}


if (searching==0)
{

  if (searchlist.length == 1)
  {
	document.styleSheets[1].cssRules[0].style.visibility='hidden'
	document.styleSheets[1].cssRules[1].style.visibility='hidden'
	document.styleSheets[1].cssRules[2].style.visibility='hidden'
	document.styleSheets[1].cssRules[3].style.visibility='hidden'
	document.styleSheets[1].cssRules[4].style.visibility='hidden'
	document.styleSheets[1].cssRules[5].style.visibility='hidden'
	document.styleSheets[1].cssRules[6].style.visibility='hidden'
	document.styleSheets[1].cssRules[7].style.visibility='hidden'
	document.styleSheets[1].cssRules[8].style.visibility='hidden'
	document.styleSheets[1].cssRules[9].style.visibility='hidden'
	document.styleSheets[1].cssRules[10].style.visibility='hidden'
	document.styleSheets[1].cssRules[11].style.visibility='hidden'
	document.styleSheets[1].cssRules[12].style.visibility='hidden'
	document.styleSheets[1].cssRules[13].style.visibility='hidden'
	document.styleSheets[1].cssRules[14].style.visibility='hidden'
	document.styleSheets[1].cssRules[15].style.visibility='hidden'
	
  }
  else if (searchlist.length==2)
  {
	document.styleSheets[1].cssRules[0].style.visibility='hidden'
	document.styleSheets[1].cssRules[1].style.visibility='hidden'
	document.styleSheets[1].cssRules[2].style.visibility='hidden'
	document.styleSheets[1].cssRules[3].style.visibility='hidden'
	document.styleSheets[1].cssRules[4].style.visibility='hidden'
	document.styleSheets[1].cssRules[5].style.visibility='hidden'
	document.styleSheets[1].cssRules[6].style.visibility='hidden'
	document.styleSheets[1].cssRules[7].style.visibility='hidden'
	document.styleSheets[1].cssRules[8].style.visibility='hidden'
	document.styleSheets[1].cssRules[9].style.visibility='hidden'
	document.styleSheets[1].cssRules[10].style.visibility='hidden'
	document.styleSheets[1].cssRules[11].style.visibility='hidden'
	document.styleSheets[1].cssRules[12].style.visibility='hidden'
	document.styleSheets[1].cssRules[13].style.visibility='hidden'
  }

  else if (searchlist.length==3)
  {
	document.styleSheets[1].cssRules[0].style.visibility='hidden'
	document.styleSheets[1].cssRules[1].style.visibility='hidden'
	document.styleSheets[1].cssRules[2].style.visibility='hidden'
	document.styleSheets[1].cssRules[3].style.visibility='hidden'
	document.styleSheets[1].cssRules[4].style.visibility='hidden'
	document.styleSheets[1].cssRules[5].style.visibility='hidden'
	document.styleSheets[1].cssRules[6].style.visibility='hidden'
	document.styleSheets[1].cssRules[7].style.visibility='hidden'
	document.styleSheets[1].cssRules[8].style.visibility='hidden'
	document.styleSheets[1].cssRules[9].style.visibility='hidden'
	document.styleSheets[1].cssRules[10].style.visibility='hidden'
	document.styleSheets[1].cssRules[11].style.visibility='hidden'
  }
  else if (searchlist.length==4)
  {
 	document.styleSheets[1].cssRules[0].style.visibility='hidden'
	document.styleSheets[1].cssRules[1].style.visibility='hidden'
	document.styleSheets[1].cssRules[2].style.visibility='hidden'
	document.styleSheets[1].cssRules[3].style.visibility='hidden'
	document.styleSheets[1].cssRules[4].style.visibility='hidden' 
	document.styleSheets[1].cssRules[5].style.visibility='hidden'
	document.styleSheets[1].cssRules[6].style.visibility='hidden'
	document.styleSheets[1].cssRules[7].style.visibility='hidden'
	document.styleSheets[1].cssRules[8].style.visibility='hidden'
	document.styleSheets[1].cssRules[9].style.visibility='hidden'
  }
  else if (searchlist.length==5)
  {
	document.styleSheets[1].cssRules[0].style.visibility='hidden'
	document.styleSheets[1].cssRules[1].style.visibility='hidden'
	document.styleSheets[1].cssRules[2].style.visibility='hidden'
	document.styleSheets[1].cssRules[3].style.visibility='hidden'
	document.styleSheets[1].cssRules[4].style.visibility='hidden'
	document.styleSheets[1].cssRules[5].style.visibility='hidden'
	document.styleSheets[1].cssRules[6].style.visibility='hidden'
	document.styleSheets[1].cssRules[7].style.visibility='hidden'

  }
  else if (searchlist.length==6)
  {
	document.styleSheets[1].cssRules[0].style.visibility='hidden'
	document.styleSheets[1].cssRules[1].style.visibility='hidden'
	document.styleSheets[1].cssRules[2].style.visibility='hidden'
	document.styleSheets[1].cssRules[3].style.visibility='hidden'
	document.styleSheets[1].cssRules[4].style.visibility='hidden'
	document.styleSheets[1].cssRules[5].style.visibility='hidden'

  }
  else if (searchlist.length==7)
  {
  	document.styleSheets[1].cssRules[0].style.visibility='hidden'
	document.styleSheets[1].cssRules[1].style.visibility='hidden'
	document.styleSheets[1].cssRules[2].style.visibility='hidden'
	document.styleSheets[1].cssRules[3].style.visibility='hidden'
	
  }
  else if (searchlist.length==8)
  {
 	document.styleSheets[1].cssRules[0].style.visibility='hidden'
	document.styleSheets[1].cssRules[1].style.visibility='hidden'
	
  }
var searchtitle=findItem( xon, searchlist[(yon + searchlist.length) % searchlist.length])

var titles1=titles[searchtitle];

<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
ratingnow=rating[searchtitle]

var imdb1= imdb[searchtitle]

var imdbnow= imdb1 / 10;
var imdbnow2= imdb1 % 10;

var videoicons =Vicons[searchtitle]
var audioicons =Aicons[searchtitle]
var ratingicons =Ricons[searchtitle]
var networkicons =Sicons[searchtitle]
</xsl:if>
<xsl:if test="$show-runtime='true'">
var newruntime = runtime[searchyear]
</xsl:if>
<xsl:if test="$show-year='true'">
var newyear = year[searchyear]
</xsl:if>
<xsl:if test="$right-corner='fanart'">
var newfanart= fanart[searchfanart]
</xsl:if>

var m1= searchlist[(yon+ searchlist.length) % searchlist.length]
var m2 =searchlist[(yon+1+ searchlist.length) % searchlist.length]
var m3 =searchlist[(yon+2+ searchlist.length) % searchlist.length]
var m4= searchlist[(yon+3+ searchlist.length) % searchlist.length]

<xsl:if test="$play-index-files='true'">
var m56 =files[(yon + xon.length) % xon.length].split(",")
</xsl:if>

var m5 =searchlist[(yon+4 + searchlist.length) % searchlist.length]
var m6 =searchlist[(yon+5+ searchlist.length) % searchlist.length]
var m7= searchlist[(yon+6+ searchlist.length) % searchlist.length]
var m8 =searchlist[(yon+7+ searchlist.length) % searchlist.length]
var m9 =searchlist[(yon+8+ searchlist.length) % searchlist.length]
}
else
{
	
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 8">
	document.styleSheets[1].cssRules[0].style.visibility='visible'
	document.styleSheets[1].cssRules[1].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 7">
	document.styleSheets[1].cssRules[2].style.visibility='visible'
	document.styleSheets[1].cssRules[3].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 6">
	document.styleSheets[1].cssRules[4].style.visibility='visible'
	document.styleSheets[1].cssRules[5].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 5">
	document.styleSheets[1].cssRules[6].style.visibility='visible'
	document.styleSheets[1].cssRules[7].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 4">
	document.styleSheets[1].cssRules[8].style.visibility='visible'
	document.styleSheets[1].cssRules[9].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 3">
	document.styleSheets[1].cssRules[10].style.visibility='visible'
	document.styleSheets[1].cssRules[11].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 2">
	document.styleSheets[1].cssRules[12].style.visibility='visible'
	document.styleSheets[1].cssRules[13].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 1">
	document.styleSheets[1].cssRules[14].style.visibility='visible'
	document.styleSheets[1].cssRules[15].style.visibility='visible'
	</xsl:if>
	
<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">	
	ratingnow=rating[(yon + xon.length) % xon.length]

var imdb1= imdb[(yon+ imdb.length) % imdb.length]

var imdbnow= imdb1 / 10;
var imdbnow2= imdb1 % 10;
</xsl:if>

var titles1= titles[(yon + titles.length) % titles.length]
var m1= xon[(yon+ xon.length) % xon.length]
var m2 =xon[(yon+1+ xon.length) % xon.length]
var m3 =xon[(yon+2+ xon.length) % xon.length]
var m4= xon[(yon+3+ xon.length) % xon.length]

<xsl:if test="$play-index-files='true'">
var m56 =files[(yon + xon.length) % xon.length].split(",")
</xsl:if>
<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
var videoicons =Vicons[(yon + xon.length) % xon.length]
var audioicons =Aicons[(yon + xon.length) % xon.length]
var ratingicons =Ricons[(yon + xon.length) % xon.length]
var networkicons =Sicons[(yon + xon.length) % xon.length]
</xsl:if>
<xsl:if test="$show-year='true'">
var newyear =year[(yon + xon.length) % xon.length]
</xsl:if>
<xsl:if test="$show-runtime='true'">
var newruntime =runtime[(yon + xon.length) % xon.length]
</xsl:if>
<xsl:if test="$right-corner='fanart'">
var newfanart =fanart[(yon + xon.length) % xon.length]
</xsl:if>

var m5 =xon[(yon+4 + xon.length) % xon.length]
var m6 =xon[(yon+5+ xon.length) % xon.length]
var m7= xon[(yon+6+ xon.length) % xon.length]
var m8 =xon[(yon+7+ xon.length) % xon.length]
var m9 =xon[(yon+8+ xon.length) % xon.length]
}




document.getElementById('image2').setAttribute("src", m2+"_large.png");
document.getElementById('image3').setAttribute("src", m3+"_large.png");
document.getElementById('image4').setAttribute("src", m4+"_large.png");
document.getElementById('image5').setAttribute("src", m5+"_large.png");

document.getElementById('image6').setAttribute("src", m6+"_large.png");
document.getElementById('image7').setAttribute("src", m7+"_large.png");
document.getElementById('image8').setAttribute("src", m8+"_large.png");
document.getElementById('image9').setAttribute("src", m9+"_large.png");

var setcheck = m1.toString();
<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
document.getElementById('videoOutput').setAttribute("src",videoicons);
document.getElementById('audioCodec').setAttribute("src",audioicons);
document.getElementById('IndexRatingIcons').setAttribute("src",ratingicons);
document.getElementById('StudioIcons').setAttribute("src",networkicons);
</xsl:if>
<xsl:if test="$show-year='true'">
document.getElementById('indexYear').firstChild.nodeValue=" "+newyear+" ";
</xsl:if>
<xsl:if test="$show-runtime='true'">
document.getElementById('indexruntime').firstChild.nodeValue="~ "+newruntime+" ";
</xsl:if>
<xsl:if test="$right-corner='fanart'">
document.getElementById('imagechange').setAttribute("src",newfanart);
</xsl:if>

document.getElementById('changeimage').setAttribute("src", m1+"_large.png");
<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
document.getElementById('rating').firstChild.nodeValue="Rated:"+ratingnow;
</xsl:if>
document.getElementById('title').firstChild.nodeValue=titles1;

<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
// Figure out how many full stars, partial stars, empty stars
var fullStars = imdb1 / 10;
var partialStars = imdb1 % 10;
var emptyStars = 10 - fullStars;
var starplace=2;



for( var i = 0; i <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> fullStars; i++ )
{
    document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstarfull.png')

	starplace=i+2;
	
}

if( partialStars <xsl:value-of select="'&gt;'" disable-output-escaping="yes"/> 0 ) 
{
	// display the appropriate partial star
	switch( partialStars )
	{
		case 1: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.1.png')
			starplace=starplace+1;
			break;
		case 2: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.2.png')
			starplace=starplace+1;
			break;
		case 3: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.3.png')
			starplace=starplace+1;
			break;
		case 4: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.4.png')
			starplace=starplace+1;
			break;
		case 5: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.5.png')
			starplace=starplace+1;
			break;
		case 6: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.6.png')
			starplace=starplace+1;
			break;
		case 7: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.7.png')
			starplace=starplace+1;
			break;
		case 8: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.8.png')
			starplace=starplace+1;
			break;
		case 9: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.9.png')
			starplace=starplace+1;
			break;
		
	}


	emptyStars--;
}

// write out empty stars
for( var i = 0; i <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> emptyStars; i++ )
{
	document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstarempty.png')
	starplace=starplace+1;
}


document.getElementById('imdbscore').firstChild.nodeValue=imdbnow+"."+imdbnow2
</xsl:if>
<xsl:choose>
<xsl:when test="library/category[@current='true' and @name ='Set']">
	if (setcheck.substring(0,3) =="Set")
		{
			
			<xsl:choose>
			  <xsl:when test="$use-parental-ratings-type2='true'">
			     if (ratingnow=="R")
			       {
			        document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
				document.getElementById('changemovie').setAttribute("href","#");
				}
			     else if (ratingnow=="PG-13")
			       {
				document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
				document.getElementById('changemovie').setAttribute("href","#");
			       }
			     else
			     {     
				document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
				document.getElementById('passwordedmovie')setAttribute("href","#");
			     }
			  </xsl:when>
			  <xsl:otherwise>
			  	document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
			  </xsl:otherwise>
			  </xsl:choose>
	
		}
	else
		{
			<xsl:choose>
			  <xsl:when test="$use-parental-ratings-type2='true'">
			     if (ratingnow=="R")
			       {
			       document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
				document.getElementById('changemovie').setAttribute("href","#");
				}
			     else if (ratingnow=="PG-13")
			       {
				document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
				document.getElementById('changemovie').setAttribute("href","#");
			       }
			     else
			     {     
				document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
			        document.getElementById('passwordedmovie')setAttribute("href","#");
			     }
			  </xsl:when>
			  <xsl:otherwise>
			  	document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
			  </xsl:otherwise>
			  </xsl:choose>
		}
</xsl:when>
<xsl:otherwise>
if (setcheck.substring(0,3) =="Set")
{
	if (flag==0)
		{
		
		
		<xsl:choose>
		<xsl:when test="$use-parental-ratings-type2='true'">
			if (ratingnow=="R")
			  {
				var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")

				document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",2,"+escape(m1)+".html,"+yon.toString()+","+twoItems[1]+"')");
				document.getElementById('changemovie').setAttribute("href","#");
			  }
			 else if (ratingnow=="PG-13")
			  {
				var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")

				document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",2,"+escape(m1)+".html,"+yon.toString()+","+twoItems[1]+"')");
				document.getElementById('changemovie').setAttribute("href","#");
			  }
			 else
			  {
				var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")

			document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",2,"+escape(m1)+".html,"+yon.toString()+","+twoItems[1]+"')");
		           document.getElementById('passwordedmovie')setAttribute("href","#");
			  }

		</xsl:when>
		<xsl:otherwise>
			var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")

			document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",2,"+escape(m1)+".html,"+yon.toString()+","+twoItems[1]+"')");
		</xsl:otherwise>
		</xsl:choose>

		}

	else

		{
			<xsl:choose>
		<xsl:when test="$use-parental-ratings-type2='true'">
			if (ratingnow=="R")
			  {
				var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		
				document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",2,"+escape(m1)+".html,"+yon.toString()+","+genreItems[1]+"')");
				document.getElementById('changemovie').setAttribute("href","#");
			  }
			 else if (ratingnow=="PG-13")
			  {
				var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		
				document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",2,"+escape(m1)+".html,"+yon.toString()+","+genreItems[1]+"')");
				document.getElementById('changemovie').setAttribute("href","#");
			  }
			 else
			  {
				var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		
				document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",2,"+escape(m1)+".html,"+yon.toString()+","+genreItems[1]+"')");
			   document.getElementById('passwordedmovie')setAttribute("href","#");
			  
			  }

		</xsl:when>
		<xsl:otherwise>
			var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		
			document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",2,"+escape(m1)+".html,"+yon.toString()+","+genreItems[1]+"')");

		</xsl:otherwise>
		</xsl:choose>

		}
}
else
{
if (flag==0)
		{
			<xsl:choose>
		<xsl:when test="$use-parental-ratings-type2='true'">
			if (ratingnow=="R")
			  {
				var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")

				document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+twoItems[1]+","+yon.toString()+","+twoItems[1]+"')");
				document.getElementById('changemovie').setAttribute("href","#");
			  }
			 else if (ratingnow=="PG-13")
			  {
				var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")

				document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+twoItems[1]+","+yon.toString()+","+twoItems[1]+"')");
				document.getElementById('changemovie').setAttribute("href","#");
			  }
			 else
			  {
				var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")

				document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+twoItems[1]+","+yon.toString()+","+twoItems[1]+"')");
				document.getElementById('passwordedmovie')setAttribute("href","#");
			  
			  }

		</xsl:when>
		<xsl:otherwise>
			var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")

			document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+twoItems[1]+","+yon.toString()+","+twoItems[1]+"')");
		</xsl:otherwise>
		</xsl:choose>


		}

	else

		{
			<xsl:choose>
		<xsl:when test="$use-parental-ratings-type2='true'">
			if (ratingnow=="R")
			  {
				var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		
				document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+genreItems[1]+","+yon.toString()+","+genreItems[1]+"')");
				document.getElementById('changemovie').setAttribute("href","#");
			  }
			 else if (ratingnow=="PG-13")
			  {
				var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		
				document.getElementById('passwordedmovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+genreItems[1]+","+yon.toString()+","+genreItems[1]+"')");
				document.getElementById('changemovie').setAttribute("href","#");
			  }
			 else
			  {
				var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		
				document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+genreItems[1]+","+yon.toString()+","+genreItems[1]+"')");
				document.getElementById('passwordedmovie')setAttribute("href","#");
			  
			  }

		</xsl:when>
		<xsl:otherwise>


			var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		
			document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+genreItems[1]+","+yon.toString()+","+genreItems[1]+"')");
		</xsl:otherwise>
		</xsl:choose>
		
		}
}
</xsl:otherwise>
</xsl:choose>

<xsl:if test="$play-index-files='true'">
	if (m56[1]=='playlist')
		{
			document.getElementById('changefile').setAttribute("href",m56[0]);
		}
	else
		{
			document.getElementById('changefile').setAttribute("href","file:///opt/sybhttpd/localhost.drives/"+m16[0]);
		}

document.getElementById('changefile').removeAttribute('vod');
document.getElementById('changefile').removeAttribute('zcd');

	if (m56[1]=='zcd')
		{
			var newAttribute = document.createAttribute("zcd");
			newAttribute.nodeValue = "2";
			document.getElementById("changefile").setAttributeNode(newAttribute);
			}
	else if (m56[1]=='playlist')
		{
			var newAttribute = document.createAttribute("vod");
			newAttribute.nodeValue = "playlist";
			document.getElementById("changefile").setAttributeNode(newAttribute);
		}
	else 
		{
			var newAttribute = document.createAttribute("vod");
			newAttribute.nodeValue = "";
			document.getElementById("changefile").setAttributeNode(newAttribute);
		}

</xsl:if>

return

}


</script>
<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
<script>

var Vicons= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:call-template name="videoOutputIndex2"></xsl:call-template>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];

if (searching == 0)
	{
	   var searchvideo=findItem( xon, searchlist[(yon + searchlist.length) % searchlist.length])
	   var videoicons =Vicons[searchvideo];
	}
else
	{
		var videoicons =Vicons[(yon + xon.length) % xon.length];
	}

document.getElementById('videoOutput').setAttribute("src",videoicons);

</script>
<script>

var Aicons= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:call-template name="audioCodecIndex2"></xsl:call-template>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];

if (searching==0)
	{
		var searchaudio=findItem( xon, searchlist[(yon + searchlist.length) % searchlist.length])
		var audioicons =Aicons[searchaudio];
	}
else
	{
		var audioicons =Aicons[(yon + xon.length) % xon.length];
	}


document.getElementById('audioCodec').setAttribute("src",audioicons);

</script>

<script>

var Ricons= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:call-template name="certificationIndex2"></xsl:call-template>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];
if (searching==0)
	{
		var searchrate=findItem( xon, searchlist[(yon + searchlist.length) % searchlist.length])
		 var ratingicons =Ricons[searchrate];
	}
else
	{
		 var ratingicons =Ricons[(yon + xon.length) % xon.length];
	}
   

document.getElementById('IndexRatingIcons').setAttribute("src",ratingicons);

</script>
<script>

var Sicons= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']"><xsl:choose><xsl:when test ="//movies/movie/season ='-1'">"<xsl:call-template name="studioIndex2"></xsl:call-template>"</xsl:when><xsl:otherwise>"<xsl:call-template name="networkIndex2"></xsl:call-template>"</xsl:otherwise></xsl:choose><xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];

if (searching==0)
	{
		var searchnetwork=findItem( xon, searchlist[(yon + searchlist.length) % searchlist.length])
		 var networkicons =Sicons[searchnetwork];
	}
else
	{
		 var networkicons =Sicons[(yon + xon.length) % xon.length];
	}
   
   var networkicons =Sicons[(yon + xon.length) % xon.length];

document.getElementById('StudioIcons').setAttribute("src",networkicons);

</script>
</xsl:if>
<xsl:if test="$show-year='true'">
<script>

var year= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:value-of select='year'/>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];

if (searching==0)
	{
		var searchyear=findItem( xon, searchlist[(yon + searchlist.length) % searchlist.length])
		 var newyear = year[searchyear];
	}
else
	{
		var newyear =year[(yon + xon.length) % xon.length];
	}

  var newyear =year[(yon + xon.length) % xon.length];

document.getElementById('indexYear').firstChild.nodeValue==" "+newyear+" ";

</script>
</xsl:if>
<xsl:if test="$show-runtime='true'">
<script>

var runtime= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:value-of select='runtime'/>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];

if (searching==0)
	{
		var searchruntime=findItem( xon, searchlist[(yon + searchlist.length) % searchlist.length])
		 var newruntime = runtime[searchruntime];
	}
else
	{
		var newruntime =runtime[(yon + xon.length) % xon.length];
	}

   var newruntime =runtime[(yon + xon.length) % xon.length];

document.getElementById('indexruntime').firstChild.nodeValuee="~ "+newruntime+"";

</script>
</xsl:if>
<xsl:if test="$right-corner='fanart'">
<script>
var fanart= [
<xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:value-of select='fanartFile'/>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];

if (searching==0)
	{
		var searchfanart = findItem( xon, searchlist[(yon + searchlist.length) % searchlist.length])
		var newfanart= fanart[searchfanart];
	}
else
	{
		var newfanart =fanart[(yon + xon.length) % xon.length];
	}

  var newfanart =fanart[(yon + xon.length) % xon.length];
document.getElementById('imagechange').setAttribute("src",newfanart);
</script>
</xsl:if>
<script>
function initpage()
{
if (flag==0)
{

var inittest = findItem( alphaim, <xsl:choose>
		<xsl:when test="//index[@current='true']/@name = '09'">
			"09,Title_09_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'A'">
			"A,Title_A_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'B'">
			"B,Title_B_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'C'">
			"C,Title_C_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'D'">
			"D,Title_D_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'E'">
			"E,Title_E_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'F'">
			"F,Title_F_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'G'">
			"G,Title_G_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'H'">
			"H,Title_H_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'I'">
			"I,Title_I_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'J'">
			"J,Title_J_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'K'">
			"K,Title_K_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'L'">
			"L,Title_L_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'M'">
			"M,Title_M_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'N'">
			"N,Title_N_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'O'">
			"O,Title_O_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'P'">
			"P,Title_P_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Q'">
			"Q,Title_Q_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'R'">
			"R,Title_R_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'S'">
			"S,Title_S_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'T'">
			"T,Title_T_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'U'">
			"U,Title_U_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'V'">
			"V,Title_V_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'W'">
			"W,Title_W_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'X'">
			"X,Title_X_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Y'">
			"Y,Title_Y_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Z'">
			"Z,Title_Z_1.html"
		</xsl:when>
		<xsl:otherwise>"09,Title_09_1.html"</xsl:otherwise></xsl:choose>)

		getParams();
yon=yon
alphaid=inittest
		

		var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")
		var twoItems2 = alphaim[(alphaid+1+ alphaim.length) % alphaim.length].split(",")
		var twoItems3 = alphaim[(alphaid+2+ alphaim.length) % alphaim.length].split(",")
		var twoItems4 = alphaim[(alphaid+3+ alphaim.length) % alphaim.length].split(",")
		var twoItems5 = alphaim[(alphaid+4+ alphaim.length) % alphaim.length].split(",")


			document.getElementById('g1').firstChild.nodeValue=twoItems2[0];
			document.getElementById('g2').firstChild.nodeValue=twoItems3[0];
			document.getElementById('g3').firstChild.nodeValue=twoItems4[0];
			document.getElementById('g4').firstChild.nodeValue=twoItems5[0];


<xsl:if test="$play-index-files='true'">
var m56 =files[(yon + xon.length) % xon.length].split(",")
</xsl:if>

var titles1= titles[(yon + titles.length) % titles.length]
var m1= xon[(yon + xon.length) % xon.length]
var m2 =xon[(yon +1+ xon.length) % xon.length]
var m3 =xon[(yon +2+ xon.length) % xon.length]
var m4= xon[(yon +3+ xon.length) % xon.length]
var m5 =xon[(yon +4+ xon.length) % xon.length]
var m6 =xon[(yon+5+ xon.length) % xon.length]
var m7= xon[(yon+6+ xon.length) % xon.length]
var m8 =xon[(yon+7+ xon.length) % xon.length]
var m9 =xon[(yon+8+ xon.length) % xon.length]
<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
ratingnow=rating[(yon + xon.length) % xon.length]


var imdb1= imdb[(yon+ imdb.length) % imdb.length];

var imdbnow= imdb1 / 10;
var imdbnow2= imdb1 % 10;

// Figure out how many full stars, partial stars, empty stars
var fullStars = imdb1 / 10;
var partialStars = imdb1 % 10;
var emptyStars = 10 - fullStars;
var starplace=2;



for( var i = 0; i <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> fullStars; i++ )
{
    document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstarfull.png')

	starplace=i+2;
	
}

if( partialStars <xsl:value-of select="'&gt;'" disable-output-escaping="yes"/> 0 ) 
{
	// display the appropriate partial star
	switch( partialStars )
	{
		case 1: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.1.png')
			starplace=starplace+1;
			break;
		case 2: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.2.png')
			starplace=starplace+1;
			break;
		case 3: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.3.png')
			starplace=starplace+1;
			break;
		case 4: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.4.png')
			starplace=starplace+1;
			break;
		case 5: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.5.png')
			starplace=starplace+1;
			break;
		case 6: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.6.png')
			starplace=starplace+1;
			break;
		case 7: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.7.png')
			starplace=starplace+1;
			break;
		case 8: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.8.png')
			starplace=starplace+1;
			break;
		case 9: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.9.png')
			starplace=starplace+1;
			break;
		
	}


	emptyStars--;
}

// write out empty stars
for( var i = 0; i <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> emptyStars; i++ )
{
	document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstarempty.png')
	starplace=starplace+1;
};

document.getElementById('imdbscore').firstChild.nodeValue=imdbnow+"."+imdbnow2

document.getElementById('rating').firstChild.nodeValue="Rated:"+ratingnow;

var videoicons =Vicons[(yon + xon.length) % xon.length]
var audioicons =Aicons[(yon + xon.length) % xon.length]
var ratingicons =Ricons[(yon + xon.length) % xon.length]
var networkicons =Sicons[(yon + xon.length) % xon.length]
</xsl:if>
<xsl:if test="$show-year='true'">
var newyear =year[(yon + xon.length) % xon.length]
</xsl:if>
<xsl:if test="$show-runtime='true'">
var newruntime =runtime[(yon + xon.length) % xon.length]
</xsl:if>
<xsl:if test="$right-corner='fanart'">
var newfanart =fanart[(yon + xon.length) % xon.length]
</xsl:if>
<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
document.getElementById('videoOutput').setAttribute("src",videoicons);
document.getElementById('audioCodec').setAttribute("src",audioicons);
document.getElementById('IndexRatingIcons').setAttribute("src",ratingicons);
document.getElementById('StudioIcons').setAttribute("src",networkicons);
</xsl:if>
<xsl:if test="$show-year='true'">
document.getElementById('indexYear').firstChild.nodeValue=" "+newyear+" ";
</xsl:if>
<xsl:if test="$show-runtime='true'">
document.getElementById('indexruntime').firstChild.nodeValue="~ "+newruntime+"";
</xsl:if>
<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
document.getElementById('rating').firstChild.nodeValue="Rated:"+ratingnow;
</xsl:if>
<xsl:if test="$right-corner='fanart'">
document.getElementById('imagechange').setAttribute("src",newfanart);
</xsl:if>
document.getElementById('title').firstChild.nodeValue=titles1;
	
document.getElementById('image2').setAttribute("src", m2+"_large.png");
document.getElementById('image3').setAttribute("src", m3+"_large.png");
document.getElementById('image4').setAttribute("src", m4+"_large.png");
document.getElementById('image5').setAttribute("src", m5+"_large.png");

document.getElementById('image6').setAttribute("src", m6+"_large.png");
document.getElementById('image7').setAttribute("src", m7+"_large.png");
document.getElementById('image8').setAttribute("src", m8+"_large.png");
document.getElementById('image9').setAttribute("src", m9+"_large.png");



<xsl:choose>
<xsl:when test="library/category[@current='true' and @name ='Set']">
document.getElementById('backbutton').setAttribute("href","javascript:setParams('"+destset+"?"+yonset+","+genrecnt+","+alphaid+","+flag+",1,"+escape(m1)+".html,"+yon.toString()+","+escape(dest)+"')");

document.getElementById('changeimage').setAttribute("src",m1+"_large.png");
document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");

</xsl:when>

<xsl:otherwise>

document.getElementById('changeimage').setAttribute("src",m1+"_large.png");
document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+twoItems[1]+","+yon.toString()+","+twoItems[1]+"')");
				</xsl:otherwise>
</xsl:choose>



<xsl:if test="$play-index-files='true'">
if (m56[1]=='playlist')
		{
			document.getElementById('changefile').setAttribute("href",m56[0]);
		}
	else
		{
			document.getElementById('changefile').setAttribute("href","file:///opt/sybhttpd/localhost.drives/"+m56[0]);
		}

document.getElementById('changefile').removeAttribute('vod');
document.getElementById('changefile').removeAttribute('zcd');

	if (m56[1]=='zcd')
		{
			var newAttribute = document.createAttribute("zcd");
			newAttribute.nodeValue = "2";
			document.getElementById("changefile").setAttributeNode(newAttribute);
			}
	else if (m56[1]=='playlist')
		{
			var newAttribute = document.createAttribute("vod");
			newAttribute.nodeValue = "playlist";
			document.getElementById("changefile").setAttributeNode(newAttribute);
		}
	else 
		{
			var newAttribute = document.createAttribute("vod");
			newAttribute.nodeValue = "";
			document.getElementById("changefile").setAttributeNode(newAttribute);
		}
		  
                
</xsl:if>
				   	
document.getElementById('change').firstChild.nodeValue=twoItems[0];
		document.getElementById('change').setAttribute("href",twoItems[1]);
				   
	  	}

else


	{
		
		var inittest = findItem( genreim, <xsl:choose><xsl:when test="//index[@current='true']/@name = 'All'">
			"All,Other_All_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name ='HD'">
			"HD,Other_HD_1.html"
			</xsl:when>
		<xsl:when test="//index[@current='true']/@name ='TV Shows'">
			"TV Shows,Other_TV Shows_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Movies'">
			"Movies,Other_Movies_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name ='Extras'">
			"Extras,Other_Extras_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'New'">
			"New,Other_New_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Action'">
			"Action,Genres_Action_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Comedy'">
			"Comedy,Genres_Comedy_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Animation'">
			"Animation,Genres_Animation_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Documentary'">
			"Documentary,Genres_Documentary_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Drama'">
			"Drama,Genres_Drama_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Fantasy'">
			"Fantasy,Genres_Fantasy_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Other'">
			"Other,Genres_Other_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Sci-Fi'">
			"Sci-Fi,Genres_Sci-Fi_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Thriller'">
			"Thriller,Genres_Thriller_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Reality-TV'">
			"Reality-TV,Genres_Reality-TV_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Horror'">
			"Horror,Genres_Horror_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Family'">
			"Family,Genres_Family_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Music'">
			"Music,Genres_Music_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Top250'">
			"Top250,Other_Top250_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'HD-720'">
			"HD-720,Other_HD-720_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'HD-1080'">
			"HD-1080,Other_HD-1080_1.html"
		</xsl:when>
		<xsl:otherwise>
			"All,Other_All_1.html"</xsl:otherwise></xsl:choose> )

		getParams();
yon=yon
<xsl:choose>
<xsl:when test="library/category[@current='true' and @name ='Set']">genrecnt=genrecnt</xsl:when>
<xsl:otherwise>genrecnt=inittest</xsl:otherwise>
</xsl:choose>


		var genreItems = genreim[(genrecnt+ genreim.length) % genreim.length].split(",")
		var genreItems2 = genreim[(genrecnt +1 + genreim.length) % genreim.length].split(",")
		   var genreItems3 = genreim[(genrecnt +2+ genreim.length) % genreim.length].split(",")
		   var genreItems4 = genreim[(genrecnt +3+ genreim.length) % genreim.length].split(",")
		   var genreItems5 = genreim[(genrecnt +4+ genreim.length) % genreim.length].split(",")
		   
			document.getElementById('g1').firstChild.nodeValue=genreItems2[0];
			document.getElementById('g2').firstChild.nodeValue=genreItems3[0];
			document.getElementById('g3').firstChild.nodeValue=genreItems4[0];
			document.getElementById('g4').firstChild.nodeValue=genreItems5[0];


<xsl:if test="$play-index-files='true'">
var m56 =files[(yon + xon.length) % xon.length].split(",")
</xsl:if>



var titles1= titles[(yon + titles.length) % titles.length]
var m1= xon[(yon + xon.length) % xon.length]
var m2 =xon[(yon +1+ xon.length) % xon.length]
var m3 =xon[(yon +2+ xon.length) % xon.length]
var m4= xon[(yon +3+ xon.length) % xon.length]
var m5 =xon[(yon +4+ xon.length) % xon.length]
var m6 =xon[(yon+5+ xon.length) % xon.length]
var m7= xon[(yon+6+ xon.length) % xon.length]
var m8 =xon[(yon+7+ xon.length) % xon.length]
var m9 =xon[(yon+8+ xon.length) % xon.length]
<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
ratingnow=rating[(yon + xon.length) % xon.length]


var imdb1= imdb[(yon+ imdb.length) % imdb.length];
var imdbnow= imdb1 / 10;
var imdbnow2= imdb1 % 10;

// Figure out how many full stars, partial stars, empty stars
var fullStars = imdb1 / 10;
var partialStars = imdb1 % 10;
var emptyStars = 10 - fullStars;
var starplace=2;



for( var i = 0; i <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> fullStars; i++ )
{
    document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstarfull.png')

	starplace=i+2;
	
}

if( partialStars <xsl:value-of select="'&gt;'" disable-output-escaping="yes"/> 0 ) 
{
	// display the appropriate partial star
	switch( partialStars )
	{
		case 1: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.1.png')
			starplace=starplace+1;
			break;
		case 2: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.2.png')
			starplace=starplace+1;
			break;
		case 3: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.3.png')
			starplace=starplace+1;
			break;
		case 4: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.4.png')
			starplace=starplace+1;
			break;
		case 5: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.5.png')
			starplace=starplace+1;
			break;
		case 6: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.6.png')
			starplace=starplace+1;
			break;
		case 7: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.7.png')
			starplace=starplace+1;
			break;
		case 8: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.8.png')
			starplace=starplace+1;
			break;
		case 9: 
			document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstar.9.png')
			starplace=starplace+1;
			break;
		
	}


	emptyStars--;
}

// write out empty stars
for( var i = 0; i <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> emptyStars; i++ )
{
	document.getElementById('star'+starplace).setAttribute('src','pictures/Stars/kstarempty.png')
	starplace=starplace+1;
};

document.getElementById('imdbscore').firstChild.nodeValue=imdbnow+"."+imdbnow2

var videoicons =Vicons[(yon + xon.length) % xon.length]
var audioicons =Aicons[(yon + xon.length) % xon.length]
var ratingicons =Ricons[(yon + xon.length) % xon.length]
var networkicons =Sicons[(yon + xon.length) % xon.length]
</xsl:if>
<xsl:if test="$show-year='true'">
var newyear =year[(yon + xon.length) % xon.length]
</xsl:if>
<xsl:if test="$show-runtime='true'">
var newruntime =runtime[(yon + xon.length) % xon.length]
</xsl:if>
<xsl:if test="$right-corner='fanart'">
var newfanart =fanart[(yon + xon.length) % xon.length]
</xsl:if>
<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
document.getElementById('videoOutput').setAttribute("src",videoicons);
document.getElementById('audioCodec').setAttribute("src",audioicons);
document.getElementById('IndexRatingIcons').setAttribute("src",ratingicons);
document.getElementById('StudioIcons').setAttribute("src",networkicons);
</xsl:if>
<xsl:if test="$show-year='true'">
document.getElementById('indexYear').firstChild.nodeValue=" "+newyear+" ";
</xsl:if>
<xsl:if test="$show-runtime='true'">
document.getElementById('indexruntime').firstChild.nodeValue="~ "+newruntime+"";
</xsl:if>
<xsl:if test="$show-icons = 'true' or $right-corner='allicons'">
document.getElementById('rating').firstChild.nodeValue="Rated:"+ratingnow;
</xsl:if>
<xsl:if test="$right-corner='fanart'">
document.getElementById('imagechange').setAttribute("src",newfanart);
</xsl:if>
document.getElementById('title').firstChild.nodeValue=titles1;


document.getElementById('changeimage').setAttribute("src",m1+"_large.png");	
document.getElementById('image2').setAttribute("src", m2+"_large.png");
document.getElementById('image3').setAttribute("src", m3+"_large.png");
document.getElementById('image4').setAttribute("src", m4+"_large.png");
document.getElementById('image5').setAttribute("src", m5+"_large.png");

document.getElementById('image6').setAttribute("src", m6+"_large.png");
document.getElementById('image7').setAttribute("src", m7+"_large.png");
document.getElementById('image8').setAttribute("src", m8+"_large.png");
document.getElementById('image9').setAttribute("src", m9+"_large.png");

<xsl:choose>
<xsl:when test="library/category[@current='true' and @name ='Set']">
document.getElementById('backbutton').setAttribute("href","javascript:setParams('"+destset+"?"+yonset+","+genrecnt+","+alphaid+","+flag+",1,"+escape(m1)+".html,"+yon.toString()+","+escape(dest)+"')");

document.getElementById('changeimage').setAttribute("src",m1+"_large.png");
document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
</xsl:when>

<xsl:otherwise>

document.getElementById('changeimage').setAttribute("src",m1+"_large.png");
document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m1)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+genreItems[1]+","+yon.toString()+","+genreItems[1]+"')");
</xsl:otherwise>
</xsl:choose>


<xsl:if test="$play-index-files='true'">
if (m56[1]=='playlist')
		{
			document.getElementById('changefile').setAttribute("href",m56[0]);
		}
	else
		{
			document.getElementById('changefile').setAttribute("href","file:///opt/sybhttpd/localhost.drives/"+m56[0]);
		}

document.getElementById('changefile').removeAttribute('vod');
document.getElementById('changefile').removeAttribute('zcd');

	if (m56[1]=='zcd')
		{
			var newAttribute = document.createAttribute("zcd");
			newAttribute.nodeValue = "2";
			document.getElementById("changefile").setAttributeNode(newAttribute);
			}
	else if (m56[1]=='playlist')
		{
			var newAttribute = document.createAttribute("vod");
			newAttribute.nodeValue = "playlist";
			document.getElementById("changefile").setAttributeNode(newAttribute);
		}
	else 
		{
			var newAttribute = document.createAttribute("vod");
			newAttribute.nodeValue = "";
			document.getElementById("changefile").setAttributeNode(newAttribute);
		}

           	
</xsl:if>
document.getElementById('change').firstChild.nodeValue=genreItems[0];
	   document.getElementById('change').setAttribute("href",genreItems[1]);


}

	
  	
  }
  </script>


  <!-- ********************************************************Start of navigation scripts used by all indexes***************************************************-->

<script>

var alphaim=[ 
<xsl:for-each select="library/category[@name='Title']/index">"<xsl:value-of select="@name" />,<xsl:value-of select="."/>.html",
</xsl:for-each>
        ];

 var genreim=[
 <xsl:for-each select="library/category[@name='Other']/index">"<xsl:value-of select="@name" />,<xsl:value-of select="."/>.html",
		 </xsl:for-each>
<xsl:for-each select="library/category[@name='Genres']/index">"<xsl:value-of select="@name" />,<xsl:value-of select="."/>.html",
       </xsl:for-each>
       	    ]


	<xsl:choose>
		<xsl:when test="//index[@current='true']/@name = '09'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'A'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'B'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'C'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'D'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'E'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'F'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'G'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'H'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'I'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'J'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'K'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'L'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'M'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'N'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'O'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'P'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Q'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'R'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'S'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'T'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'U'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'V'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'W'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'X'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Y'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Z'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'All'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name ='HD'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name ='TV Shows'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Movies'">
			var flag = 1;
		</xsl:when>
		<xsl:when test=" //index[@current='true']/@name ='Extras'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'New'">
			var flag = 1;
		</xsl:when>

		<xsl:when test="//index[@current='true']/@name = 'Action'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Comedy'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Animation'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Documentary'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Drama'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Fantasy'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Other'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Sci-Fi'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Thriller'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Reality-TV'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Horror'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Music'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Top250'">
			var flag =1;
		</xsl:when>
		<xsl:otherwise>
			var flag =1;
		</xsl:otherwise>
	</xsl:choose>

function alphaud(x)	//moves the letters left and right 
  	{
	var glen = alphaim.length
	var ending = glen - 1
	var last = ending - 1

  		 if (alphaid+x<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>0)
		 {
		 alphaid=ending
		 }
		 else if (alphaid+x<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>ending)
		 {
		 alphaid=0
		 }
		 else 
		 {
		    alphaid=alphaid+x
			}
	    var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")
			
			var twoItems2 = alphaim[(alphaid+1+ alphaim.length) % alphaim.length].split(",")
var twoItems3 = alphaim[(alphaid+2+ alphaim.length) % alphaim.length].split(",")
var twoItems4 = alphaim[(alphaid+3+ alphaim.length) % alphaim.length].split(",")
var twoItems5 = alphaim[(alphaid+4+ alphaim.length) % alphaim.length].split(",")


			document.getElementById('g1').firstChild.nodeValue=twoItems2[0];
			document.getElementById('g2').firstChild.nodeValue=twoItems3[0];
			document.getElementById('g3').firstChild.nodeValue=twoItems4[0];
			document.getElementById('g4').firstChild.nodeValue=twoItems5[0];
		 
					document.getElementById('change').firstChild.nodeValue=twoItems[0];
				   document.getElementById('change').setAttribute("href",twoItems[1]);
  	}

 function genrelist(x)	//moves the genres left and right
  	{
	var glen = genreim.length
	var ending = glen - 1
	var last = ending - 1

  		 if (genrecnt+x<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>0)
		 {
		 genrecnt=ending
		 }
		 else if (genrecnt+x<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>ending)
		 {
		 genrecnt=0
		 }
		 else 
		 {
  		   genrecnt=genrecnt+x;
		 }
	   var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		   var genreItems2 = genreim[(genrecnt +1 + genreim.length) % genreim.length].split(",")
		   var genreItems3 = genreim[(genrecnt +2+ genreim.length) % genreim.length].split(",")
		   var genreItems4 = genreim[(genrecnt +3+ genreim.length) % genreim.length].split(",")
		   var genreItems5 = genreim[(genrecnt +4+ genreim.length) % genreim.length].split(",")
		   
			document.getElementById('g1').firstChild.nodeValue=genreItems2[0];
			document.getElementById('g2').firstChild.nodeValue=genreItems3[0];
			document.getElementById('g3').firstChild.nodeValue=genreItems4[0];
			document.getElementById('g4').firstChild.nodeValue=genreItems5[0];

                   document.getElementById('change').firstChild.nodeValue=genreItems[0];
				   document.getElementById('change').setAttribute("href",genreItems[1]);
	}

 function loadletter()	//change the list to letters 
  	{
		flag=0
		{
		   alphaid=alphaid
  			    var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")
			
			var twoItems2 = alphaim[(alphaid+1+ alphaim.length) % alphaim.length].split(",")
var twoItems3 = alphaim[(alphaid+2+ alphaim.length) % alphaim.length].split(",")
var twoItems4 = alphaim[(alphaid+3+ alphaim.length) % alphaim.length].split(",")
var twoItems5 = alphaim[(alphaid+4+ alphaim.length) % alphaim.length].split(",")


			document.getElementById('g1').firstChild.nodeValue=twoItems2[0];
			document.getElementById('g2').firstChild.nodeValue=twoItems3[0];
			document.getElementById('g3').firstChild.nodeValue=twoItems4[0];
			document.getElementById('g4').firstChild.nodeValue=twoItems5[0];
		 
					document.getElementById('change').firstChild.nodeValue=twoItems[0];
				   document.getElementById('change').setAttribute("href",twoItems[1]);

	  	}
return false
  	}

 function loadgenre()	//change the list to genres 
  	{
     flag=1
	 	{
			genrecnt=genrecnt		
  		   var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		   var genreItems2 = genreim[(genrecnt +1 + genreim.length) % genreim.length].split(",")
		   var genreItems3 = genreim[(genrecnt +2+ genreim.length) % genreim.length].split(",")
		   var genreItems4 = genreim[(genrecnt +3+ genreim.length) % genreim.length].split(",")
		   var genreItems5 = genreim[(genrecnt +4+ genreim.length) % genreim.length].split(",")
		   
			document.getElementById('g1').firstChild.nodeValue=genreItems2[0];
			document.getElementById('g2').firstChild.nodeValue=genreItems3[0];
			document.getElementById('g3').firstChild.nodeValue=genreItems4[0];
			document.getElementById('g4').firstChild.nodeValue=genreItems5[0];

                   document.getElementById('change').firstChild.nodeValue=genreItems[0];
				   document.getElementById('change').setAttribute("href",genreItems[1]);
			 }
		return
  	}
function upDown(x)
{
  if (flag== 0)
    alphaud(x)
  else
    genrelist(x)
  return false
  }

 function changeformat()
 {
 if (flag==0) 
	{
	loadgenre()
	}
 else
	{
	loadletter()
	}
}

function findItem( list, item ) {
	var result = -1;

	for( var i = 0; i != list.length; i++ ) {
	  if( list[i] == item ) {
		return i;
		}
	}
	return result;
}
</script>

<!--****************************************************************END OF NAVIGATION SCRIPTS*******************************************************************-->


<!--****************************************************************MISC SCRIPTS IN THE WORKS*******************************************************************-->
<script>
function initClock() {
        updateClock();
        setInterval('updateClock();', 1000);
    }
    
function updateClock() {

var currentTime = new Date()
  var hours = currentTime.getHours()
  var minutes = currentTime.getMinutes()

  var suffix = "AM";
  if (hours >= 12) {
  suffix = "PM";
  hours = hours - 12;
  }
  if (hours == 0) {
  hours = 12;
  }

  if (minutes <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> 10)
  minutes = "0" + minutes

  document.getElementById('time').firstChild.nodeValue = hours + ":" + minutes + " " + suffix

  var myDate = new Date();
 document.getElementById('date').firstChild.nodeValue = myDate.toDateString();
        
    }
</script>

<script type="text/javascript">
var toggle=1;

function togglePopup(x)
{

  if ( toggle == 1 )
   {
	document.getElementById('navchange').setAttribute("href","#middle");
	
	toggle=0;
  }
  else
   {
	document.getElementById('navchange').setAttribute("href","#movies4");
	
	toggle=1;
  }
  return
}
</script>

<xsl:if test="$parental-control-on='true'">
<script type="text/javascript">

function prompter() 
{
<xsl:choose>
<xsl:when test="$number-of-children > 1">

if (ratingnow<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>=<xsl:value-of select="$childs-age-youngest"/>)
{
	if (ratingnow<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>=<xsl:value-of select="$childs-age-oldest"/>)
		{		
			var reply = prompt("Password?", "")

				if (reply=="<xsl:value-of select="$parental-password-master"/>")
					{
						return
					}
				else 
					{
						alert ( "Sorry,You have entered the wrong password")
						return false
					}
		}
	<xsl:if test="$number-of-children=3">
	else if (ratingnow<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>=<xsl:value-of select="$childs-age-middle"/>)
		{		
			var reply = prompt("Password?", "")

				if (reply=="<xsl:value-of select="$parental-password-oldest"/>" || reply=="<xsl:value-of select="$parental-password-master"/>")
					{
						return
					}
				else 
					{
						alert ( "Sorry,You have entered the wrong password")
						return false
					}
		}
	</xsl:if>

	else
		{		
			var reply = prompt("Password?", "")

				if (reply=="<xsl:value-of select="$parental-password-middle"/>" || reply=="<xsl:value-of select="$parental-password-oldest"/>" || reply=="<xsl:value-of select="$parental-password-master"/>")
					{
						return
					}
				else 
					{
						alert ( "Sorry,You have entered the wrong password")
						return false
					}
		}
}
</xsl:when>
<xsl:otherwise>
if (ratingnow<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>=<xsl:value-of select="$childs-age-youngest"/>)
{
	var reply = prompt("What's the Password?", "")

				if (reply=="<xsl:value-of select="$parental-password-master"/>")
					{
						return
					}
				else 
					{
						alert ( "Sorry,You have entered the wrong password")
						return false
					}
		}
}
</xsl:otherwise>
</xsl:choose>
else
{
return
}


}
</script>
</xsl:if>

<xsl:if test="$use-menu='true'">
<SCRIPT>

	var helpscreen= [
	
	<xsl:for-each select="library/category[@name='Title']/index">
	<xsl:choose>
		<xsl:when test="@name = '09'">
			"09: 1",
		</xsl:when>
		<xsl:when test="@name = 'A'">
			"A: 2",
		</xsl:when>
		<xsl:when test="@name = 'B'">
			"B: 22",
		</xsl:when>
		<xsl:when test="@name = 'C'">
			"C: 222",
		</xsl:when>
		<xsl:when test="@name = 'D'">
			"D: 3",
		</xsl:when>
		<xsl:when test="@name = 'E'">
			"E: 33",
		</xsl:when>
		<xsl:when test="@name = 'F'">
			"F: 333",
		</xsl:when>
		<xsl:when test="@name = 'G'">
			"G: 4",
		</xsl:when>
		<xsl:when test="@name = 'H'">
			"H: 44",
		</xsl:when>
		<xsl:when test="@name = 'I'">
			"I: 444",
		</xsl:when>
		<xsl:when test="@name = 'J'">
			"J: 5",
		</xsl:when>
		<xsl:when test="@name = 'K'">
			"K: 55",
		</xsl:when>
		<xsl:when test="@name = 'L'">
			"L: 555",
		</xsl:when>
		<xsl:when test="@name = 'M'">
			"M: 6",
		</xsl:when>
		<xsl:when test="@name = 'N'">
			"N: 66",
		</xsl:when>
		<xsl:when test="@name = 'O'">
			"O: 666",
		</xsl:when>
		<xsl:when test="@name = 'P'">
			"P: 7",
		</xsl:when>
		<xsl:when test="@name = 'Q'">
			"Q: 77",
		</xsl:when>
		<xsl:when test="@name = 'R'">
			"R: 777",
		</xsl:when>
		<xsl:when test="@name = 'S'">
			"S: 7777",
		</xsl:when>
		<xsl:when test="@name = 'T'">
			"T: 8",
		</xsl:when>
		<xsl:when test="@name = 'U'">
			"U: 88",
		</xsl:when>
		<xsl:when test="@name = 'V'">
			"V: 888",
		</xsl:when>
		<xsl:when test="@name = 'W'">
			"W: 9",
		</xsl:when>
		<xsl:when test="@name = 'X'">
			"X: 99",
		</xsl:when>
		<xsl:when test="@name = 'Y'">
			"Y: 999",
		</xsl:when>
		<xsl:when test="@name = 'Z'">
			"Z: 9999",
		</xsl:when>
		</xsl:choose>
               </xsl:for-each>
<xsl:for-each select="library/category[@name='Other']/index">
	<xsl:choose>
	    <xsl:when test="@name = 'All'">
			"ALL: 255",
		</xsl:when>
		<xsl:when test="@name = 'HD'">
			"HD: 43",
		</xsl:when>
		<xsl:when test="@name = 'TV Shows'">
			"TV SHOWS: 887",
		</xsl:when>
		<xsl:when test="@name = 'Movies'">
			"MOVIES: 668",
		</xsl:when>
		<xsl:when test="@name = 'Extras'">
			"ExtraS: 398",
		</xsl:when>
		<xsl:when test="@name = 'New'">
			"NEW: 639",
		</xsl:when>
		<xsl:when test="@name = 'Top250'">
			"TOP250: 807",
		</xsl:when>
		<xsl:when test="@name = 'HD-720'">
			"HD-720: 437"
		</xsl:when>
		<xsl:when test="@name = 'HD-1080'">
			"HD-1080: 431"
		</xsl:when>
	</xsl:choose>	    
</xsl:for-each>
<xsl:for-each select="library/category[@name='Genres']/index">
	<xsl:choose>
	    <xsl:when test="@name = 'Action'">
			"ACTION: 228",
		</xsl:when>
		<xsl:when test="@name = 'Animation'">
			"ANIMATION: 264",
		</xsl:when>
		<xsl:when test="@name = 'Comedy'">
			"COMEDY: 266",
		</xsl:when>
		<xsl:when test="@name = 'Documentary'">
			"DOCUMENTARY: 362",
		</xsl:when>
		<xsl:when test="@name = 'Drama'">
			"DRAMA: 372",
		</xsl:when>
		<xsl:when test="@name = 'Fantasy'">
			"FANTASY: 326",
		</xsl:when>
		<xsl:when test="@name = 'Other'">
			"OTHER: 684",
		</xsl:when>
		<xsl:when test="@name = 'Sci-Fi'">
			"SCI-FI: 724",
		</xsl:when>
		<xsl:when test="@name = 'Thriller'">
			"THRILLER: 847",
		</xsl:when>
		<xsl:when test="@name = 'Reality'">
			"REALITY: 732",
		</xsl:when>
		<xsl:when test="@name = 'Horror'">
			"HORROR: 467",
		</xsl:when>
		<xsl:when test="@name = 'Family'">
			"FAMILY: 3264",
		</xsl:when>
		<xsl:when test="@name = 'Music'">
			"MUSIC: 687",
		</xsl:when>
		<xsl:otherwise>
		</xsl:otherwise>
	</xsl:choose>	    
</xsl:for-each>
"NAV MENU: INFO",
"+1 MOVIE: RIGHT",
"-1 MOVIE: LEFT",
"+9 MOVIES: DOWN",
"-9 MOVIES: UP",
"+27 MOVIES: PAGEDOWN",
"-27 MOVIES: PAGEUP",
<xsl:if test="$play-index-files='true'">"PLAY MOVIE: PLAY",</xsl:if>
"<xsl:choose><xsl:when test="//index[@current='true']/@name = 'All'">INDEX.HTM: HOME</xsl:when><xsl:otherwise>All INDEX: HOME</xsl:otherwise></xsl:choose>",
];

function menu()
{
var menulength=helpscreen.length
var i=0;

while (i<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>=menulength-1)
{
var x=i+1
document.getElementById('div'+x).firstChild.nodeValue=helpscreen[i];
i=i+1;
}
}

function menutoggle()
{
  var temp = document.styleSheets[1].cssRules[21].style
  
   if ( temp.visibility == 'visible' )
   {
	temp.visibility = 'hidden'

	document.styleSheets[1].cssRules[22].style.visibility='hidden'
	document.styleSheets[1].cssRules[23].style.visibility='hidden'
	document.styleSheets[1].cssRules[24].style.visibility='hidden'
	document.styleSheets[1].cssRules[25].style.visibility='hidden'
	document.styleSheets[1].cssRules[26].style.visibility='hidden'
	document.styleSheets[1].cssRules[27].style.visibility='hidden'
	document.styleSheets[1].cssRules[28].style.visibility='hidden'
	document.styleSheets[1].cssRules[29].style.visibility='hidden'
	document.styleSheets[1].cssRules[30].style.visibility='hidden'
	document.styleSheets[1].cssRules[31].style.visibility='hidden'
	document.styleSheets[1].cssRules[32].style.visibility='hidden'
	document.styleSheets[1].cssRules[33].style.visibility='hidden'
	document.styleSheets[1].cssRules[34].style.visibility='hidden'
	document.styleSheets[1].cssRules[35].style.visibility='hidden'
	document.styleSheets[1].cssRules[36].style.visibility='hidden'
	document.styleSheets[1].cssRules[37].style.visibility='hidden'
	document.styleSheets[1].cssRules[38].style.visibility='hidden'
	document.styleSheets[1].cssRules[39].style.visibility='hidden'
	document.styleSheets[1].cssRules[40].style.visibility='hidden'
	document.styleSheets[1].cssRules[41].style.visibility='hidden'
	document.styleSheets[1].cssRules[42].style.visibility='hidden'
	document.styleSheets[1].cssRules[43].style.visibility='hidden'
	document.styleSheets[1].cssRules[44].style.visibility='hidden'
	document.styleSheets[1].cssRules[45].style.visibility='hidden'
	document.styleSheets[1].cssRules[46].style.visibility='hidden'
	document.styleSheets[1].cssRules[47].style.visibility='hidden'
	document.styleSheets[1].cssRules[48].style.visibility='hidden'
	document.styleSheets[1].cssRules[49].style.visibility='hidden'
	document.styleSheets[1].cssRules[50].style.visibility='hidden'
	document.styleSheets[1].cssRules[51].style.visibility='hidden'
	document.styleSheets[1].cssRules[52].style.visibility='hidden'
	document.styleSheets[1].cssRules[53].style.visibility='hidden'
	document.styleSheets[1].cssRules[54].style.visibility='hidden'
	document.styleSheets[1].cssRules[55].style.visibility='hidden'
	document.styleSheets[1].cssRules[56].style.visibility='hidden'
	document.styleSheets[1].cssRules[57].style.visibility='hidden'
	document.styleSheets[1].cssRules[58].style.visibility='hidden'
	document.styleSheets[1].cssRules[59].style.visibility='hidden'
	document.styleSheets[1].cssRules[60].style.visibility='hidden'
	document.styleSheets[1].cssRules[61].style.visibility='hidden'
	document.styleSheets[1].cssRules[62].style.visibility='hidden'
	document.styleSheets[1].cssRules[63].style.visibility='hidden'
	document.styleSheets[1].cssRules[64].style.visibility='hidden'
	document.styleSheets[1].cssRules[65].style.visibility='hidden'
	document.styleSheets[1].cssRules[66].style.visibility='hidden'
	document.styleSheets[1].cssRules[67].style.visibility='hidden'
	document.styleSheets[1].cssRules[68].style.visibility='hidden'
	document.styleSheets[1].cssRules[69].style.visibility='hidden'
	document.styleSheets[1].cssRules[70].style.visibility='hidden'
	document.styleSheets[1].cssRules[71].style.visibility='hidden'
	document.styleSheets[1].cssRules[72].style.visibility='hidden'
	document.styleSheets[1].cssRules[73].style.visibility='hidden'
	document.styleSheets[1].cssRules[74].style.visibility='hidden'
	document.styleSheets[1].cssRules[75].style.visibility='hidden'
	document.styleSheets[1].cssRules[76].style.visibility='hidden'
	document.styleSheets[1].cssRules[77].style.visibility='hidden'
	document.styleSheets[1].cssRules[78].style.visibility='hidden'
	document.styleSheets[1].cssRules[79].style.visibility='hidden'
	document.styleSheets[1].cssRules[80].style.visibility='hidden'
	document.styleSheets[1].cssRules[81].style.visibility='hidden'
	document.styleSheets[1].cssRules[82].style.visibility='hidden'
	document.styleSheets[1].cssRules[83].style.visibility='hidden'
	document.styleSheets[1].cssRules[84].style.visibility='hidden'
	document.styleSheets[1].cssRules[85].style.visibility='hidden'

	document.getElementById('changeimage').setAttribute("onfocussrc","pictures/indexmaincoveroverlay.png");

	document.getElementById('changeimage').focus()
	}

	else
	{

	temp.visibility = 'visible'
	document.styleSheets[1].cssRules[22].style.visibility='visible'
	document.styleSheets[1].cssRules[23].style.visibility='visible'
	document.styleSheets[1].cssRules[24].style.visibility='visible'
	document.styleSheets[1].cssRules[25].style.visibility='visible'
	document.styleSheets[1].cssRules[26].style.visibility='visible'
	document.styleSheets[1].cssRules[27].style.visibility='visible'
	document.styleSheets[1].cssRules[28].style.visibility='visible'
	document.styleSheets[1].cssRules[29].style.visibility='visible'
	document.styleSheets[1].cssRules[30].style.visibility='visible'
	document.styleSheets[1].cssRules[31].style.visibility='visible'
	document.styleSheets[1].cssRules[32].style.visibility='visible'
	document.styleSheets[1].cssRules[33].style.visibility='visible'
	document.styleSheets[1].cssRules[34].style.visibility='visible'
	document.styleSheets[1].cssRules[35].style.visibility='visible'
	document.styleSheets[1].cssRules[36].style.visibility='visible'
	document.styleSheets[1].cssRules[37].style.visibility='visible'
	document.styleSheets[1].cssRules[38].style.visibility='visible'
	document.styleSheets[1].cssRules[39].style.visibility='visible'
	document.styleSheets[1].cssRules[40].style.visibility='visible'
	document.styleSheets[1].cssRules[41].style.visibility='visible'
	document.styleSheets[1].cssRules[42].style.visibility='visible'
	document.styleSheets[1].cssRules[43].style.visibility='visible'
	document.styleSheets[1].cssRules[44].style.visibility='visible'
	document.styleSheets[1].cssRules[45].style.visibility='visible'
	document.styleSheets[1].cssRules[46].style.visibility='visible'
	document.styleSheets[1].cssRules[47].style.visibility='visible'
	document.styleSheets[1].cssRules[48].style.visibility='visible'
	document.styleSheets[1].cssRules[49].style.visibility='visible'
	document.styleSheets[1].cssRules[50].style.visibility='visible'
	document.styleSheets[1].cssRules[51].style.visibility='visible'
	document.styleSheets[1].cssRules[52].style.visibility='visible'
	document.styleSheets[1].cssRules[53].style.visibility='visible'
	document.styleSheets[1].cssRules[54].style.visibility='visible'
	document.styleSheets[1].cssRules[55].style.visibility='visible'
	document.styleSheets[1].cssRules[56].style.visibility='visible'
	document.styleSheets[1].cssRules[57].style.visibility='visible'
	document.styleSheets[1].cssRules[58].style.visibility='visible'
	document.styleSheets[1].cssRules[59].style.visibility='visible'
	document.styleSheets[1].cssRules[60].style.visibility='visible'
	document.styleSheets[1].cssRules[61].style.visibility='visible'
	document.styleSheets[1].cssRules[62].style.visibility='visible'
	document.styleSheets[1].cssRules[63].style.visibility='visible'
	document.styleSheets[1].cssRules[64].style.visibility='visible'
	document.styleSheets[1].cssRules[65].style.visibility='visible'
	document.styleSheets[1].cssRules[66].style.visibility='visible'
	document.styleSheets[1].cssRules[67].style.visibility='visible'
	document.styleSheets[1].cssRules[68].style.visibility='visible'
	document.styleSheets[1].cssRules[69].style.visibility='visible'
	document.styleSheets[1].cssRules[70].style.visibility='visible'
	document.styleSheets[1].cssRules[71].style.visibility='visible'
	document.styleSheets[1].cssRules[72].style.visibility='visible'
	document.styleSheets[1].cssRules[73].style.visibility='visible'
	document.styleSheets[1].cssRules[74].style.visibility='visible'
	document.styleSheets[1].cssRules[75].style.visibility='visible'
	document.styleSheets[1].cssRules[76].style.visibility='visible'
	document.styleSheets[1].cssRules[77].style.visibility='visible'
	document.styleSheets[1].cssRules[78].style.visibility='visible'
	document.styleSheets[1].cssRules[79].style.visibility='visible'
	document.styleSheets[1].cssRules[80].style.visibility='visible'
	document.styleSheets[1].cssRules[81].style.visibility='visible'
	document.styleSheets[1].cssRules[82].style.visibility='visible'
	document.styleSheets[1].cssRules[83].style.visibility='visible'
	document.styleSheets[1].cssRules[84].style.visibility='visible'
	document.styleSheets[1].cssRules[85].style.visibility='visible'

	document.getElementById('changeimage').setAttribute("onfocussrc","pictures/indexmaincoveroverlay-blank.png");


	document.getElementById('menutoggle').focus()
   }
   
  return false
}

</SCRIPT>
</xsl:if>

<!--*************************************END of MISC SCripts*********************************************-->


  </xsl:template>

<!--*******************************************************END OF STYLE AND JAVASCRIPT****************************************************-->



<!--*******************************************************START OF HTML******************************************************************-->
  

<xsl:template name="set-index-html">

<xsl:attribute name="background">pictures/bg35.jpg</xsl:attribute>


<xsl:for-each select="library/category[@name='Title']/index">
	<xsl:choose>
		<xsl:when test="@name = '09'">
			<a href="Title_09_1.html" tvid="1"></a>
		</xsl:when>
		<xsl:when test="@name = 'A'">
			<a href="Title_A_1.html" tvid="2"></a>
		</xsl:when>
		<xsl:when test="@name = 'B'">
			<a href="Title_B_1.html" tvid="22"></a>
		</xsl:when>
		<xsl:when test="@name = 'C'">
			<a href="Title_C_1.html" tvid="222"></a>
		</xsl:when>
		<xsl:when test="@name = 'D'">
			<a href="Title_D_1.html" tvid="3"></a>
		</xsl:when>
		<xsl:when test="@name = 'E'">
			<a href="Title_E_1.html" tvid="33"></a>
		</xsl:when>
		<xsl:when test="@name = 'F'">
			<a href="Title_F_1.html" tvid="333"></a>
		</xsl:when>
		<xsl:when test="@name = 'G'">
			<a href="Title_G_1.html" tvid="4"></a>
		</xsl:when>
		<xsl:when test="@name = 'H'">
			<a href="Title_H_1.html" tvid="44"></a>
		</xsl:when>
		<xsl:when test="@name = 'I'">
			<a href="Title_I_1.html" tvid="444"></a>
		</xsl:when>
		<xsl:when test="@name = 'J'">
			<a href="Title_J_1.html" tvid="5"></a>
		</xsl:when>
		<xsl:when test="@name = 'K'">
			<a href="Title_K_1.html" tvid="55"></a>
		</xsl:when>
		<xsl:when test="@name = 'L'">
			<a href="Title_L_1.html" tvid="555"></a>
		</xsl:when>
		<xsl:when test="@name = 'M'">
			<a href="Title_M_1.html" tvid="6"></a>
		</xsl:when>
		<xsl:when test="@name = 'N'">
			<a href="Title_N_1.html" tvid="66"></a>
		</xsl:when>
		<xsl:when test="@name = 'O'">
			<a href="Title_O_1.html" tvid="666"></a>
		</xsl:when>
		<xsl:when test="@name = 'P'">
			<a href="Title_P_1.html" tvid="7"></a>
		</xsl:when>
		<xsl:when test="@name = 'Q'">
			<a href="Title_Q_1.html" tvid="77"></a>
		</xsl:when>
		<xsl:when test="@name = 'R'">
			<a href="Title_R_1.html" tvid="777"></a>
		</xsl:when>
		<xsl:when test="@name = 'S'">
			<a href="Title_S_1.html" tvid="7777"></a>
		</xsl:when>
		<xsl:when test="@name = 'T'">
			<a href="Title_T_1.html" tvid="8"></a>
		</xsl:when>
		<xsl:when test="@name = 'U'">
			<a href="Title_U_1.html" tvid="88"></a>
		</xsl:when>
		<xsl:when test="@name = 'V'">
			<a href="Title_V_1.html" tvid="888"></a>
		</xsl:when>
		<xsl:when test="@name = 'W'">
			<a href="Title_W_1.html" tvid="9"></a>
		</xsl:when>
		<xsl:when test="@name = 'X'">
			<a href="Title_X_1.html" tvid="99"></a>
		</xsl:when>
		<xsl:when test="@name = 'Y'">
			<a href="Title_Y_1.html" tvid="999"></a>
		</xsl:when>
		<xsl:when test="@name = 'Z'">
			<a href="Title_Z_1.html" tvid="9999"></a>
		</xsl:when>

		<xsl:otherwise>
		<a href="blank" tvid="blank"></a>
		</xsl:otherwise>
		</xsl:choose>
               </xsl:for-each>

<xsl:for-each select="library/category[@name='Other']/index">
	<xsl:choose>
	    <xsl:when test="@name = 'All'">
			<a href="Other_All_1.html" tvid="255"/>
		</xsl:when>
		<xsl:when test="@name = 'HD'">
			<a href="Other_HD_1.html" tvid="43"/>
		</xsl:when>
		<xsl:when test="@name = 'TV Shows'">
			<a href="Other_TV Shows_1.html" tvid="887"/>
		</xsl:when>
		<xsl:when test="@name = 'Movies'">
			<a href="Other_Movies_1.html" tvid="668"/>
		</xsl:when>
		<xsl:when test="@name = 'Extras'">
			<a href="Other_Extras_1.html" tvid="398"/>
		</xsl:when>
		<xsl:when test="@name = 'New'">
			<a href="Other_New_1.html" tvid="639"/>
		</xsl:when>
		<xsl:when test="@name = 'Top250'">
			<a href="Other_Top250_1.html" tvid="807"/>
		</xsl:when>
		<xsl:when test="@name = 'HD-720'">
			<a href="Other_HD-720_1.html" tvid="437"/>
		</xsl:when>
		<xsl:when test="@name = 'HD-1080'">
			<a href="Other_HD-1080_1.html" tvid="431"/>
		</xsl:when>
		<xsl:otherwise>
		<a href="blank" tvid="blank"></a>
		</xsl:otherwise>
	</xsl:choose>	    
</xsl:for-each>

<xsl:for-each select="library/category[@name='Genres']/index">
	<xsl:choose>
	    <xsl:when test="@name = 'Action'">
			<a href="Genres_Action_1.html" tvid="228"/>
		</xsl:when>
		<xsl:when test="@name = 'Animation'">
			<a href="Genres_Animation_1.html" tvid="264"/>
		</xsl:when>
		<xsl:when test="@name = 'Comedy'">
			<a href="Genres_Comedy_1.html" tvid="266"/>
		</xsl:when>
		<xsl:when test="@name = 'Documentary'">
			<a href="Genres_Documentary_1.html" tvid="362"/>
		</xsl:when>
		<xsl:when test="@name = 'Drama'">
			<a href="Genres_Drama_1.html" tvid="372"/>
		</xsl:when>
		<xsl:when test="@name = 'Fantasy'">
			<a href="Genres_Fantasy_1.html" tvid="326"/>
		</xsl:when>
		<xsl:when test="@name = 'Other'">
			<a href="Genres_Other_1.html" tvid="684"/>
		</xsl:when>
		<xsl:when test="@name = 'Sci-Fi'">
			<a href="Genres_Sci-Fi_1.html" tvid="724"/>
		</xsl:when>
		<xsl:when test="@name = 'Thriller'">
			<a href="Genres_Thriller_1.html" tvid="847"/>
		</xsl:when>
		<xsl:when test="@name = 'Reality'">
			<a href="Genres_Reality_1.html" tvid="732"/>
		</xsl:when>
		<xsl:when test="@name = 'Horror'">
			<a href="Genres_Horror_1.html" tvid="467"/>
		</xsl:when>
		<xsl:when test="@name = 'Family'">
			<a href="Genres_Family_1.html" tvid="3264"/>
		</xsl:when>
		<xsl:when test="@name = 'Music'">
			<a href="Genres_Music_1.html" tvid="687"/>
		</xsl:when>
		<xsl:otherwise>
		<a href="blank" tvid="blank"></a>
		</xsl:otherwise>
	</xsl:choose>	    
</xsl:for-each>

<xsl:choose>
	<xsl:when test="//index[@current='true']/@name = 'All'">
		<a tvid="HOME"><xsl:attribute name="href"><xsl:value-of select="$index-home-button"/></xsl:attribute></a>            
	</xsl:when>
	<xsl:otherwise>
		<a tvid="HOME"><xsl:attribute name="href"><xsl:value-of select="$index-home-button-other"/></xsl:attribute></a>
	</xsl:otherwise>
</xsl:choose>


<a href="#" onclick="return togglePopup(1)" id="navchange" tvid="info" />

<xsl:if test="library/category[@current='true' and @name ='Set']">
	<a href="#" id="backbutton" tvid="back"/>
</xsl:if>

<a href="#middle" onclick="testing()" tvid="clear"/>
<a href="#middle" onfocusload="" onfocus="return changeformat()" onclick="return changeformat()" name="leters" class="sorting2" TVID="GREEN"></a>
<a href="#middle" onfocusload="" onfocus="return upDown(-1)" onclick="return upDown(-1)" name="left" onkeyrightset="middle" id="up" TVID="RED"></a>
<a href="#middle" onfocusload="" onfocus="return upDown(1)" onclick="return upDown(1)" name="right" onkeyleftset="middle" id="down" TVID="BLUE"></a>
<a href="#" onclick="searchthis()" id="menutoggle" name="menutoggle"><xsl:attribute name="tvid"><xsl:value-of select="$search-button"/></xsl:attribute></a>


<a href="#movies4" onfocusload="" onfocus="return moviechange4(1)" onclick="return moviechange4(1)" name="rightn"/>
<a href="#movies4" onfocusload="" onfocus="return moviechange4(-1)" onclick="return moviechange4(-1)" name="leftn"/>
<a href="#movies4" onfocusload="" onfocus="return moviechange4(9)" onclick="return moviechange4(9)" name="downn"/>
<a href="#movies4" onfocusload="" onfocus="return moviechange4(-9)" onclick="return moviechange4(-9)" name="upn"/>
<a href="#movies4" onfocusload="" onfocus="return moviechange4(27)" onclick="return moviechange4(27)" tvid="pgdn"/>
<a href="#movies4" onfocusload="" onfocus="return moviechange4(-27)" onclick="return moviechange4(-27)" tvid="pgup"/>

<xsl:if test="$use-parental-ratings-type2='true'">
	<a href="#" id="passwordedmovie">
		<xsl:attribute name="tvid"><xsl:value-of select="$parental-control-type2-password"/></xsl:attribute>
	</a>
</xsl:if>

<xsl:if test="$play-index-files='true'">
	<a>
		<xsl:attribute name="href"><xsl:value-of select="library/movies/movie[position()=1]/files/file/fileURL"/></xsl:attribute>
		<xsl:attribute name="id">changefile</xsl:attribute>
		<xsl:attribute name="tvid">play</xsl:attribute>
	 <xsl:choose>
			<xsl:when test="//movie/container='DVD Video' or //movie/container='dvd video'">
				<xsl:attribute name="zcd">2</xsl:attribute>
			</xsl:when>
			<xsl:when test="//movie/container='ISO' or //movie/container='iso'">
				<xsl:attribute name="zcd">2</xsl:attribute>
			</xsl:when>
			<xsl:when test="//movie/container='IMG' or //movie/container='img'">	
				<xsl:attribute name="zcd">2</xsl:attribute>
			</xsl:when>
			<xsl:when test="substring(files/file[1]/fileURL,string-length(files/file[1]/fileURL)-7,8) = 'VIDEO_TS'">
				<xsl:attribute name="zcd">2</xsl:attribute> 
			</xsl:when>
			<xsl:when test="//movie/container='vob' or //movie/container='VOB' and $nomenus='true'">
				<xsl:attribute name="vod"/> 
			</xsl:when>
			<xsl:when test="//movie/container='vob' or //movie/container='VOB'">
				<xsl:attribute name="zcd">2</xsl:attribute> 
			</xsl:when>
			<xsl:when test="//movie/container= 'MDF' or //movie/container='mdf'">
				<xsl:attribute name="zcd">2</xsl:attribute>
			</xsl:when>
			<xsl:when test="//movie/container= 'NRG' or //movie/container='nrg'">
				<xsl:attribute name="zcd">2</xsl:attribute>
			</xsl:when>
			<xsl:when test="//movie/container= 'BIN' or //movie/container='bin'">
				<xsl:attribute name="zcd">2</xsl:attribute>
			</xsl:when>
			<xsl:otherwise>
				<xsl:attribute name="vod"/>
			</xsl:otherwise>
			</xsl:choose> 
	 </a>
</xsl:if>

<table width="1100" height="656" border="0">
		<tr>
			<td  height="50" align="left" valign="top">
				<table border="0">
					<tr>
						<xsl:choose>
							<xsl:when test="$show-icons='true' and $right-corner='icons' or $right-corner='allicons'">
							<td>
								<table border="0">
									<td class="title1" align="left" id="title">Batman Begins</td>
								<xsl:if test="$show-year='true'">
									<td class="moviedetails4" valign="bottom" width="75" align="right" id="indexYear">2010</td>
								</xsl:if>
								<xsl:if test="$show-runtime='true'">
									<td class="moviedetails4" valign="bottom" width="90" align="right" id="indexruntime">150 min</td>
								</xsl:if>
								</table>
							</td>
							</xsl:when>
							<xsl:otherwise>
							<td colspan="5">
								<table border="0">
									<td class="title1" align="left" id="title">Batman Begins</td>
								<xsl:if test="$show-year='true'">
									<td class="moviedetails4" valign="bottom" width="75" align="right" id="indexYear">2010</td>
								</xsl:if>
								<xsl:if test="$show-runtime='true'">
									<td class="moviedetails4" valign="bottom" width="90" align="right" id="indexruntime">150 min</td>
								</xsl:if>
								</table>
							</td>
							</xsl:otherwise>
							</xsl:choose>
					</tr>
					<xsl:if test="$show-icons='true'">
					<tr>
						<td align="center">
							<table>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star1"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star2"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star3"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star4"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star5"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star6"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star7"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star8"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star9"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star10"/>
								</td>
								<td width="5"></td>
								<td id="imdbscore" class="moviedetails3">.</td>
							</table>
						</td>
						<xsl:choose>
							<xsl:when test="$right-corner ='icons'">
								<td class="mediumfont" align="center"></td>
								<td class="mediumfont" align="center"></td>
							</xsl:when>
							<xsl:otherwise>
								<td align="center" class="moviedetails3" id="IconVideo"><img id="videoOutput" src="pictures/t-1080p.png" height="35" /></td>
								<td align="center" class="moviedetails3" id="audioOutput"><img id="audioCodec" src="pictures/t-dts.png"  height="35" /></td>
								<td align="center" class="moviedetails3" id="Studio"><img id="StudioIcons" src="pictures/studios/warner.png"  height="35" /></td>
								<td align="center" class="moviedetails3" id="rating"><img id="IndexRatingIcons" src="pictures/certificates/R.png" height="35"/></td>
							</xsl:otherwise>
						</xsl:choose>
					</tr>
					</xsl:if>
				</table>
			</td>
			<td height="50" align="right" valign="top" width="250">
				<table align="right" border="0">
					<tr>
						<td align="center" class="title2" width="50" id="searchfilter">-</td>
						<td align="right" class="title2" width="200">
							<a href="Other_All_1.html" class="title2" name="middle" onkeyupset="left" onkeydownset="right" onkeyleftset="leters" onkeyrightset="leters" id="change">All</a>
						</td>
						
					</tr>
					<tr>
						<td align="right" colspan="2">
							<img width="250" height="2" src="pictures/index2-sort-line.png"/></td>
					</tr>
					<tr>
						<td align="right" colspan="2" class="mediumfont" id="g1">HD</td>
					</tr>
					<tr>
						<td align="right" colspan="2" class="mediumfont" id="g2">Tv Shows</td>
					</tr>
					<tr>
						<td align="right" colspan="2" class="mediumfont" id="g3">Action</td>
					</tr>
					<tr>
						<td align="right" colspan="2" class="mediumfont" id="g4">Comedy</td>
					</tr>
				</table>
			</td>
	</tr>
	<tr>
		<td colspan="2" height="495" align="right" valign="bottom">
			<table border="0">
				<tr>
					<xsl:if test="$right-corner ='clean'">
						<td class="mediumfont" align="center"></td>
					</xsl:if>
					<xsl:if test="$right-corner ='date'">
						<td align="right"  height="35">
							<table>
								<td class="mediumfont" align="right" width="120" id="time">17:16 PM</td>
							</table>
						</td>
					</xsl:if>
					<xsl:if test="$right-corner ='search'">
						<td class="mediumfont" align="center">Search</td>
					</xsl:if>
				</tr>
				<xsl:if test="$right-corner ='date'">
					<tr>
						<td align="right"  height="35">
							<table>
								<td class="mediumfont" align="right" id="date">November 1, 2009</td>
							</table>
						</td>
					</tr>
				</xsl:if>
				<xsl:if test="$right-corner ='search'">
					<tr>
						<td class="episodePlot" align="center">
						<a href="#" onclick="searchthis()" id="menutoggle" name="menutoggle" tvid="tab">
							<img src="pictures/test4.png" width="100"/>
						</a>
						</td>
					</tr>
				</xsl:if>
				<xsl:if test="$right-corner ='icons'">
					<tr>
						<td align="right" width="300">
						<table>
						<td align="center" class="moviedetails3" id="IconVideo"><img id="videoOutput" src="pictures/t-1080p.png" height="35" /></td>
						<td align="center" class="moviedetails3" id="audioOutput"><img id="audioCodec" src="pictures/t-dts.png"  height="35" /></td>
						<td align="center" class="moviedetails3" id="Studio"><img id="StudioIcons" src="pictures/studios/warner.png"  height="35" /></td>
						<td align="center" class="moviedetails3" id="rating"><img id="IndexRatingIcons" src="pictures/certificates/R.png" height="35"/></td>
						</table>
						</td>
					</tr>
				</xsl:if>
				<xsl:if test="$right-corner ='allicons'">
					<tr>
						<td align="right" width="450">
						<table>
						<td align="center" class="moviedetails3" id="IconVideo"><img id="videoOutput" src="pictures/t-1080p.png" height="35" /></td>
						<td align="center" class="moviedetails3" id="audioOutput"><img id="audioCodec" src="pictures/t-dts.png"  height="35" /></td>
						<td align="center" class="moviedetails3" id="Studio"><img id="StudioIcons" src="pictures/studios/warner.png"  height="35" /></td>
						<td align="center" class="moviedetails3" id="rating"><img id="IndexRatingIcons" src="pictures/certificates/R.png" height="35"/></td>
						</table>
						</td>
					</tr>
					<tr>
						<td colspan="4" align="center">
							<table>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star1"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star2"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star3"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star4"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star5"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star6"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star7"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star8"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star9"/>
								</td>
								<td>
									<img src="pictures/Stars/kstarfull.png" id="star10"/>
								</td>
								<td width="5"></td>
								<td width="35" id="imdbscore" class="moviedetails3">.</td>
							</table>
						</td>
					</tr>
				</xsl:if>
			</table>

		</td>
	</tr>
</table>
			<img width="65" id="image9">
				<xsl:attribute name="src">
					<xsl:value-of select="library/movies/movie[position()=9]/thumbnail"/>
				</xsl:attribute>
			</img>
			<img width="75" id="overlay9" src="pictures/index2-box-overlay.png"/>

			<img width="80" id="image8">
				<xsl:attribute name="src">
					<xsl:value-of select="library/movies/movie[position()=8]/thumbnail"/>
				</xsl:attribute>
			</img>
			<img width="94" id="overlay8" src="pictures/index2-box-overlay.png"/>

			<img width="100" id="image7">
				<xsl:attribute name="src">
					<xsl:value-of select="library/movies/movie[position()=7]/thumbnail"/>
				</xsl:attribute>
			</img>
			<img width="116" id="overlay7" src="pictures/index2-box-overlay.png"/>

			<img width="125" id="image6">
				<xsl:attribute name="src">
					<xsl:value-of select="library/movies/movie[position()=6]/thumbnail"/>
				</xsl:attribute>
			</img>
			<img width="145" id="overlay6" src="pictures/index2-box-overlay.png"/>

			<img width="150" id="image5">
				<xsl:attribute name="src">
					<xsl:value-of select="library/movies/movie[position()=5]/thumbnail"/>
				</xsl:attribute>
			</img>
			<img width="175" id="overlay5" src="pictures/index2-box-overlay.png"/>

			<img  width="175" id="image4">
				<xsl:attribute name="src">
					<xsl:value-of select="library/movies/movie[position()=4]/thumbnail"/>
				</xsl:attribute>
			</img>
			<img width="203" id="overlay4" src="pictures/index2-box-overlay.png"/>

			<img width="200" id="image3">
				<xsl:attribute name="src">
					<xsl:value-of select="library/movies/movie[position()=3]/thumbnail"/>
				</xsl:attribute>
			</img>
			<img width="233" id="overlay3" src="pictures/index2-box-overlay.png"/>

			<img width="225" id="image2">
				<xsl:attribute name="src">
					<xsl:value-of select="library/movies/movie[position()=2]/thumbnail"/>
				</xsl:attribute>
			</img>
			<img width="260" id="overlay2" src="pictures/index2-box-overlay.png"/>
			
			
			<div id="five">
				<a>
					<xsl:attribute name="href"><xsl:value-of select="library/movies/movie[position()=1]/details"/></xsl:attribute>
					<xsl:attribute name="id">changemovie</xsl:attribute>
					<xsl:attribute name="name">movies4</xsl:attribute>
					<xsl:attribute name="onkeyupset">upn</xsl:attribute>
					 <xsl:attribute name="onkeydownset">downn</xsl:attribute>
				 	 <xsl:attribute name="onkeyleftset">leftn</xsl:attribute>
				 	 <xsl:attribute name="onkeyrightset">rightn</xsl:attribute>
					 <xsl:if test="$parental-control-on='true'">
						<xsl:attribute name="onclick">return prompter()</xsl:attribute>
					</xsl:if>

				<img src="pictures/index2-box-overlay.png">
					 <xsl:attribute name="width">300</xsl:attribute>
					 <xsl:attribute name="id">firstimageoverlay</xsl:attribute>
					 <xsl:attribute name="onkeyupset">upn</xsl:attribute>
					 <xsl:attribute name="onkeydownset">downn</xsl:attribute>
				 	 <xsl:attribute name="onkeyleftset">leftn</xsl:attribute>
				 	 <xsl:attribute name="onkeyrightset">rightn</xsl:attribute>
					 <!--<xsl:attribute name="onfocussrc">pictures/cover_clear.png</xsl:attribute>-->
				</img>
				
				</a>
			</div>
			
			<img>
					<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/thumbnail"/></xsl:attribute>
					<xsl:attribute name="width">260</xsl:attribute>
					<xsl:attribute name="id">changeimage</xsl:attribute>
			</img>



<xsl:if test="$right-corner='fanart'">
<xsl:choose>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 8">
		<img>
			<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/fanartFile"/></xsl:attribute>
			<xsl:attribute name="width">300</xsl:attribute>
			<xsl:attribute name="id">imagechange</xsl:attribute>
		</img>
		<img>
			<xsl:attribute name="src">pictures/fanartframe5.png</xsl:attribute>
			<xsl:attribute name="width">300</xsl:attribute>
			<xsl:attribute name="id">fanartoverlay</xsl:attribute>
		</img>
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 7">
		<img>
			<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/fanartFile"/></xsl:attribute>
			<xsl:attribute name="width">300</xsl:attribute>
			<xsl:attribute name="id">imagechange</xsl:attribute>
		</img>
		<img>
			<xsl:attribute name="src">pictures/fanartframe5.png</xsl:attribute>
			<xsl:attribute name="width">300</xsl:attribute>
			<xsl:attribute name="id">fanartoverlay</xsl:attribute>
		</img>
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 6">
		<img>
			<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/fanartFile"/></xsl:attribute>
			<xsl:attribute name="width">300</xsl:attribute>
			<xsl:attribute name="id">imagechange</xsl:attribute>
		</img>
		<img>
			<xsl:attribute name="src">pictures/fanartframe5.png</xsl:attribute>
			<xsl:attribute name="width">300</xsl:attribute>
			<xsl:attribute name="id">fanartoverlay</xsl:attribute>
		</img>
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 5">
		<img>
			<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/fanartFile"/></xsl:attribute>
			<xsl:attribute name="width">300</xsl:attribute>
			<xsl:attribute name="id">imagechange</xsl:attribute>
		</img>
		<img>
			<xsl:attribute name="src">pictures/fanartframe5.png</xsl:attribute>
			<xsl:attribute name="width">300</xsl:attribute>
			<xsl:attribute name="id">fanartoverlay</xsl:attribute>
		</img>
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 4">
		<img>
			<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/fanartFile"/></xsl:attribute>
			<xsl:attribute name="width">300</xsl:attribute>
			<xsl:attribute name="id">imagechange</xsl:attribute>
		</img>
		<img>
			<xsl:attribute name="src">pictures/fanartframe5.png</xsl:attribute>
			<xsl:attribute name="width">300</xsl:attribute>
			<xsl:attribute name="id">fanartoverlay</xsl:attribute>
		</img>
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 3">
		<img>
			<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/fanartFile"/></xsl:attribute>
			<xsl:attribute name="width">320</xsl:attribute>
			<xsl:attribute name="id">imagechange</xsl:attribute>
		</img>
		<img>
			<xsl:attribute name="src">pictures/fanartframe5.png</xsl:attribute>
			<xsl:attribute name="width">320</xsl:attribute>
			<xsl:attribute name="id">fanartoverlay</xsl:attribute>
		</img>
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 2">
		<img>
			<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/fanartFile"/></xsl:attribute>
			<xsl:attribute name="width">450</xsl:attribute>
			<xsl:attribute name="id">imagechange</xsl:attribute>
		</img>
		<img>
			<xsl:attribute name="src">pictures/fanartframe5.png</xsl:attribute>
			<xsl:attribute name="width">450</xsl:attribute>
			<xsl:attribute name="id">fanartoverlay</xsl:attribute>
		</img>
	</xsl:when>
	<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 1">
		<img>
			<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/fanartFile"/></xsl:attribute>
			<xsl:attribute name="width">580</xsl:attribute>
			<xsl:attribute name="id">imagechange</xsl:attribute>
		</img>
		<img>
			<xsl:attribute name="src">pictures/fanartframe5.png</xsl:attribute>
			<xsl:attribute name="width">580</xsl:attribute>
			<xsl:attribute name="id">fanartoverlay</xsl:attribute>
		</img>
	</xsl:when>
</xsl:choose>
</xsl:if>

  </xsl:template>
</xsl:stylesheet>